diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2017-12-19 10:25:40 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2017-12-19 10:25:40 +0200 |
| commit | afc7a07d285e08d905c58dd5978441c155b2f296 (patch) | |
| tree | a2f4f51ef2747ae3a2aded2637a352ce8ef85934 | |
| parent | ad35c9c2df0001157ea13312382f3cdfdad67f06 (diff) | |
| download | Tango-afc7a07d285e08d905c58dd5978441c155b2f296.tar.gz Tango-afc7a07d285e08d905c58dd5978441c155b2f296.zip | |
MERGE.
350 files changed, 34339 insertions, 1131 deletions
diff --git a/Software/Android_Studio/Tango.Core/src/main/java/com/twine/tango/core/DescriptionAnnotation.java b/Software/Android_Studio/Tango.Core/src/main/java/com/twine/tango/core/DescriptionAnnotation.java new file mode 100644 index 000000000..31c0e587a --- /dev/null +++ b/Software/Android_Studio/Tango.Core/src/main/java/com/twine/tango/core/DescriptionAnnotation.java @@ -0,0 +1,17 @@ +package com.twine.tango.core; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface DescriptionAnnotation { + /** + * Field description. + * + * @return the string + */ + String description() default ""; +}
\ No newline at end of file diff --git a/Software/Android_Studio/Tango.DAL/build.gradle b/Software/Android_Studio/Tango.DAL/build.gradle index efd90c7c5..86c71c619 100644 --- a/Software/Android_Studio/Tango.DAL/build.gradle +++ b/Software/Android_Studio/Tango.DAL/build.gradle @@ -49,6 +49,7 @@ dependencies { compile globalDependencies.logging compile globalDependencies.storage + compile globalDependencies.joda compile group: 'commons-io', name: 'commons-io', version: '2.4' } @@ -60,4 +61,16 @@ task copyFiles(type: Copy) { rename ('Tango.db', 'tangodb') } -preBuild.dependsOn(copyFiles)
\ No newline at end of file +//Generate DAL Entities. +task generateEntities(type: Exec, description: 'Generate DAL Entities') { + + commandLine '..\\Visual_Studio\\Build\\Debug\\dbobgen.exe', 'src\\main\\java\\com\\twine\\tango\\dal', '-java', + + ext.output = { + return standardOutput.toString() + } +} + +preBuild.dependsOn(copyFiles) + +preBuild.dependsOn(generateEntities)
\ No newline at end of file diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/DateConverter.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/DateConverter.java new file mode 100644 index 000000000..165d0f161 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/DateConverter.java @@ -0,0 +1,35 @@ +package com.twine.tango.dal; +import com.raizlabs.android.dbflow.converter.TypeConverter; +import com.twine.tango.dal.enumerations.EnumDemo; + +import org.joda.time.DateTime; +import org.joda.time.format.DateTimeFormat; +import org.joda.time.format.DateTimeFormatter; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + + +/** + * Represents a DBFlow string to date converter used to parse and store SQLite dates. + */ +@com.raizlabs.android.dbflow.annotation.TypeConverter +public class DateConverter extends TypeConverter<String,DateTime> +{ + + @Override + public String getDBValue(DateTime model) + { + DateTimeFormatter dtfOut = DateTimeFormat.forPattern("yyyy-MM-dd hh:mm:ss"); + return dtfOut.print(model); + } + + @Override + public DateTime getModelValue(String data) + { + DateTimeFormatter dtf = DateTimeFormat.forPattern("yyyy-MM-dd hh:mm:ss"); + DateTime jodatime = dtf.parseDateTime(data); + return jodatime; + } +} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Entity.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/Entity.java index 64b24b00c..fd41d9230 100644 --- a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Entity.java +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/Entity.java @@ -1,10 +1,12 @@ -package com.twine.tango.dal.entities; +package com.twine.tango.dal; import com.raizlabs.android.dbflow.annotation.Column; import com.raizlabs.android.dbflow.annotation.PrimaryKey; import com.raizlabs.android.dbflow.rx2.structure.BaseRXModel; -import java.util.Date; +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; + import java.util.UUID; @@ -22,7 +24,7 @@ public class Entity extends BaseRXModel private String guid; @Column(name = "LAST_UPDATED",typeConverter = DateConverter.class) - private Date last_updated; + private DateTime last_updated; @Column(name = "DELETED") private boolean deleted; @@ -72,7 +74,7 @@ public class Entity extends BaseRXModel * * @return the last updated */ - public Date getLast_updated() + public DateTime getLast_updated() { return last_updated; } @@ -82,7 +84,7 @@ public class Entity extends BaseRXModel * * @param last_updated the last updated */ - public void setLast_updated(Date last_updated) + public void setLast_updated(DateTime last_updated) { this.last_updated = last_updated; } @@ -113,6 +115,6 @@ public class Entity extends BaseRXModel public Entity() { setGuid(UUID.randomUUID().toString()); - setLast_updated(new Date()); + setLast_updated(DateTime.now(DateTimeZone.UTC)); } } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/dao/OrganizationsDAO.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/dao/OrganizationsDAO.java deleted file mode 100644 index 2fb669bbb..000000000 --- a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/dao/OrganizationsDAO.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.twine.tango.dal.dao; - -import com.raizlabs.android.dbflow.sql.language.SQLite; -import com.twine.tango.dal.entities.Organization; - -import java.util.List; - -/** - * Created by Roy on 12/2/2017. - */ - -public class OrganizationsDAO -{ - public static List<Organization> getAllOrganizations() - { - return SQLite.select().from(Organization.class).queryList(); - } -} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/dao/TangoDAO.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/dao/TangoDAO.java new file mode 100644 index 000000000..e02fc0b3f --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/dao/TangoDAO.java @@ -0,0 +1,438 @@ +package com.twine.tango.dal.dao; + +import com.raizlabs.android.dbflow.sql.language.SQLite; +import com.twine.tango.dal.entities.Action; +import com.twine.tango.dal.entities.Address; +import com.twine.tango.dal.entities.ApplicationDisplayPanelVersion; +import com.twine.tango.dal.entities.ApplicationFirmwareVersion; +import com.twine.tango.dal.entities.ApplicationOsVersion; +import com.twine.tango.dal.entities.ApplicationVersion; +import com.twine.tango.dal.entities.CartridgeType; +import com.twine.tango.dal.entities.Cartridge; +import com.twine.tango.dal.entities.Configuration; +import com.twine.tango.dal.entities.Contact; +import com.twine.tango.dal.entities.DispenserType; +import com.twine.tango.dal.entities.Dispenser; +import com.twine.tango.dal.entities.EmbeddedFirmwareVersion; +import com.twine.tango.dal.entities.EmbeddedSoftwareVersion; +import com.twine.tango.dal.entities.Event; +import com.twine.tango.dal.entities.EventsAction; +import com.twine.tango.dal.entities.FiberShape; +import com.twine.tango.dal.entities.FiberSynth; +import com.twine.tango.dal.entities.HardwareVersion; +import com.twine.tango.dal.entities.IdsPack; +import com.twine.tango.dal.entities.LinearMassDensityUnit; +import com.twine.tango.dal.entities.Liquid; +import com.twine.tango.dal.entities.LiquidsRml; +import com.twine.tango.dal.entities.MachineVersion; +import com.twine.tango.dal.entities.Machine; +import com.twine.tango.dal.entities.MachinesConfiguration; +import com.twine.tango.dal.entities.MachinesEvent; +import com.twine.tango.dal.entities.MediaColor; +import com.twine.tango.dal.entities.MediaCondition; +import com.twine.tango.dal.entities.MediaMaterial; +import com.twine.tango.dal.entities.MediaPurpose; +import com.twine.tango.dal.entities.Organization; +import com.twine.tango.dal.entities.Permission; +import com.twine.tango.dal.entities.Rml; +import com.twine.tango.dal.entities.Role; +import com.twine.tango.dal.entities.RolesPermission; +import com.twine.tango.dal.entities.SyncConfiguration; +import com.twine.tango.dal.entities.User; +import com.twine.tango.dal.entities.UsersRole; +import java.util.List; + +public class TangoDAO +{ + + /** + * Gets all the Actions from database. + * + * @return all Actions + */ + public static List<Action> getAllActions() + { + return SQLite.select().from(Action.class).queryList(); + } + + /** + * Gets all the Addresses from database. + * + * @return all Addresses + */ + public static List<Address> getAllAddresses() + { + return SQLite.select().from(Address.class).queryList(); + } + + /** + * Gets all the ApplicationDisplayPanelVersions from database. + * + * @return all ApplicationDisplayPanelVersions + */ + public static List<ApplicationDisplayPanelVersion> getAllApplicationDisplayPanelVersions() + { + return SQLite.select().from(ApplicationDisplayPanelVersion.class).queryList(); + } + + /** + * Gets all the ApplicationFirmwareVersions from database. + * + * @return all ApplicationFirmwareVersions + */ + public static List<ApplicationFirmwareVersion> getAllApplicationFirmwareVersions() + { + return SQLite.select().from(ApplicationFirmwareVersion.class).queryList(); + } + + /** + * Gets all the ApplicationOsVersions from database. + * + * @return all ApplicationOsVersions + */ + public static List<ApplicationOsVersion> getAllApplicationOsVersions() + { + return SQLite.select().from(ApplicationOsVersion.class).queryList(); + } + + /** + * Gets all the ApplicationVersions from database. + * + * @return all ApplicationVersions + */ + public static List<ApplicationVersion> getAllApplicationVersions() + { + return SQLite.select().from(ApplicationVersion.class).queryList(); + } + + /** + * Gets all the CartridgeTypes from database. + * + * @return all CartridgeTypes + */ + public static List<CartridgeType> getAllCartridgeTypes() + { + return SQLite.select().from(CartridgeType.class).queryList(); + } + + /** + * Gets all the Cartridges from database. + * + * @return all Cartridges + */ + public static List<Cartridge> getAllCartridges() + { + return SQLite.select().from(Cartridge.class).queryList(); + } + + /** + * Gets all the Configurations from database. + * + * @return all Configurations + */ + public static List<Configuration> getAllConfigurations() + { + return SQLite.select().from(Configuration.class).queryList(); + } + + /** + * Gets all the Contacts from database. + * + * @return all Contacts + */ + public static List<Contact> getAllContacts() + { + return SQLite.select().from(Contact.class).queryList(); + } + + /** + * Gets all the DispenserTypes from database. + * + * @return all DispenserTypes + */ + public static List<DispenserType> getAllDispenserTypes() + { + return SQLite.select().from(DispenserType.class).queryList(); + } + + /** + * Gets all the Dispensers from database. + * + * @return all Dispensers + */ + public static List<Dispenser> getAllDispensers() + { + return SQLite.select().from(Dispenser.class).queryList(); + } + + /** + * Gets all the EmbeddedFirmwareVersions from database. + * + * @return all EmbeddedFirmwareVersions + */ + public static List<EmbeddedFirmwareVersion> getAllEmbeddedFirmwareVersions() + { + return SQLite.select().from(EmbeddedFirmwareVersion.class).queryList(); + } + + /** + * Gets all the EmbeddedSoftwareVersions from database. + * + * @return all EmbeddedSoftwareVersions + */ + public static List<EmbeddedSoftwareVersion> getAllEmbeddedSoftwareVersions() + { + return SQLite.select().from(EmbeddedSoftwareVersion.class).queryList(); + } + + /** + * Gets all the Events from database. + * + * @return all Events + */ + public static List<Event> getAllEvents() + { + return SQLite.select().from(Event.class).queryList(); + } + + /** + * Gets all the EventsActions from database. + * + * @return all EventsActions + */ + public static List<EventsAction> getAllEventsActions() + { + return SQLite.select().from(EventsAction.class).queryList(); + } + + /** + * Gets all the FiberShapes from database. + * + * @return all FiberShapes + */ + public static List<FiberShape> getAllFiberShapes() + { + return SQLite.select().from(FiberShape.class).queryList(); + } + + /** + * Gets all the FiberSynths from database. + * + * @return all FiberSynths + */ + public static List<FiberSynth> getAllFiberSynths() + { + return SQLite.select().from(FiberSynth.class).queryList(); + } + + /** + * Gets all the HardwareVersions from database. + * + * @return all HardwareVersions + */ + public static List<HardwareVersion> getAllHardwareVersions() + { + return SQLite.select().from(HardwareVersion.class).queryList(); + } + + /** + * Gets all the IdsPacks from database. + * + * @return all IdsPacks + */ + public static List<IdsPack> getAllIdsPacks() + { + return SQLite.select().from(IdsPack.class).queryList(); + } + + /** + * Gets all the LinearMassDensityUnits from database. + * + * @return all LinearMassDensityUnits + */ + public static List<LinearMassDensityUnit> getAllLinearMassDensityUnits() + { + return SQLite.select().from(LinearMassDensityUnit.class).queryList(); + } + + /** + * Gets all the Liquids from database. + * + * @return all Liquids + */ + public static List<Liquid> getAllLiquids() + { + return SQLite.select().from(Liquid.class).queryList(); + } + + /** + * Gets all the LiquidsRmls from database. + * + * @return all LiquidsRmls + */ + public static List<LiquidsRml> getAllLiquidsRmls() + { + return SQLite.select().from(LiquidsRml.class).queryList(); + } + + /** + * Gets all the MachineVersions from database. + * + * @return all MachineVersions + */ + public static List<MachineVersion> getAllMachineVersions() + { + return SQLite.select().from(MachineVersion.class).queryList(); + } + + /** + * Gets all the Machines from database. + * + * @return all Machines + */ + public static List<Machine> getAllMachines() + { + return SQLite.select().from(Machine.class).queryList(); + } + + /** + * Gets all the MachinesConfigurations from database. + * + * @return all MachinesConfigurations + */ + public static List<MachinesConfiguration> getAllMachinesConfigurations() + { + return SQLite.select().from(MachinesConfiguration.class).queryList(); + } + + /** + * Gets all the MachinesEvents from database. + * + * @return all MachinesEvents + */ + public static List<MachinesEvent> getAllMachinesEvents() + { + return SQLite.select().from(MachinesEvent.class).queryList(); + } + + /** + * Gets all the MediaColors from database. + * + * @return all MediaColors + */ + public static List<MediaColor> getAllMediaColors() + { + return SQLite.select().from(MediaColor.class).queryList(); + } + + /** + * Gets all the MediaConditions from database. + * + * @return all MediaConditions + */ + public static List<MediaCondition> getAllMediaConditions() + { + return SQLite.select().from(MediaCondition.class).queryList(); + } + + /** + * Gets all the MediaMaterials from database. + * + * @return all MediaMaterials + */ + public static List<MediaMaterial> getAllMediaMaterials() + { + return SQLite.select().from(MediaMaterial.class).queryList(); + } + + /** + * Gets all the MediaPurposes from database. + * + * @return all MediaPurposes + */ + public static List<MediaPurpose> getAllMediaPurposes() + { + return SQLite.select().from(MediaPurpose.class).queryList(); + } + + /** + * Gets all the Organizations from database. + * + * @return all Organizations + */ + public static List<Organization> getAllOrganizations() + { + return SQLite.select().from(Organization.class).queryList(); + } + + /** + * Gets all the Permissions from database. + * + * @return all Permissions + */ + public static List<Permission> getAllPermissions() + { + return SQLite.select().from(Permission.class).queryList(); + } + + /** + * Gets all the Rmls from database. + * + * @return all Rmls + */ + public static List<Rml> getAllRmls() + { + return SQLite.select().from(Rml.class).queryList(); + } + + /** + * Gets all the Roles from database. + * + * @return all Roles + */ + public static List<Role> getAllRoles() + { + return SQLite.select().from(Role.class).queryList(); + } + + /** + * Gets all the RolesPermissions from database. + * + * @return all RolesPermissions + */ + public static List<RolesPermission> getAllRolesPermissions() + { + return SQLite.select().from(RolesPermission.class).queryList(); + } + + /** + * Gets all the SyncConfigurations from database. + * + * @return all SyncConfigurations + */ + public static List<SyncConfiguration> getAllSyncConfigurations() + { + return SQLite.select().from(SyncConfiguration.class).queryList(); + } + + /** + * Gets all the Users from database. + * + * @return all Users + */ + public static List<User> getAllUsers() + { + return SQLite.select().from(User.class).queryList(); + } + + /** + * Gets all the UsersRoles from database. + * + * @return all UsersRoles + */ + public static List<UsersRole> getAllUsersRoles() + { + return SQLite.select().from(UsersRole.class).queryList(); + } + +} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Action.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Action.java new file mode 100644 index 000000000..ac0cb892f --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Action.java @@ -0,0 +1,94 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "ACTIONS", database = TangoDB.class) + public class Action extends Entity + { + + @Column(name = "CODE") + private int code; + + + + @Column(name = "NAME") + private String name; + + + + @Column(name = "DESCRIPTION") + private String description; + + + + + /** + * Gets the Code. + * + * return the Code + */ + public int getCode() + { + return code; + } + + /** + * Sets the Code. + * + * @param code the Code + */ + public void setCode(int code) + { + this.code = code; + } + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Gets the Description. + * + * return the Description + */ + public String getDescription() + { + return description; + } + + /** + * Sets the Description. + * + * @param description the Description + */ + public void setDescription(String description) + { + this.description = description; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Address.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Address.java index 116f1af88..199d8f923 100644 --- a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Address.java +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Address.java @@ -1,174 +1,198 @@ package com.twine.tango.dal.entities; import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; import com.twine.tango.dal.TangoDB; -/** - * Represents the DAL Address entity. - */ -@Table(name = "ADDRESSES", database = TangoDB.class) -public class Address extends Entity -{ - @Column(name = "ADDRESS") - private String address; - - @Column(name = "LOCALITY") - private String locality; - - @Column(name = "COUNTRY") - private String country; - - @Column(name = "CITY") - private String city; - - @Column(name = "STATE") - private String state; - - @Column(name = "COUNTRY_CODE") - private String country_code; - - @Column(name = "POSTAL_CODE") - private String postal_code; - - /** - * Gets the address. - * - * @return the address - */ - public String getAddress() + @Table(name = "ADDRESSES", database = TangoDB.class) + public class Address extends Entity { - return address; - } - /** - * Sets address. - * - * @param address the address - */ - public void setAddress(String address) - { - this.address = address; - } + @Column(name = "ADDRESS_STRING") + private String addressString; + - /** - * Gets locality. - * - * @return the locality - */ - public String getLocality() - { - return locality; - } - /** - * Sets locality. - * - * @param locality the locality - */ - public void setLocality(String locality) - { - this.locality = locality; - } + @Column(name = "LOCALITY") + private String locality; + - /** - * Gets country. - * - * @return the country - */ - public String getCountry() - { - return country; - } - /** - * Sets country. - * - * @param country the country - */ - public void setCountry(String country) - { - this.country = country; - } + @Column(name = "COUNTRY") + private String country; + - /** - * Gets city. - * - * @return the city - */ - public String getCity() - { - return city; - } - /** - * Sets city. - * - * @param city the city - */ - public void setCity(String city) - { - this.city = city; - } + @Column(name = "CITY") + private String city; + - /** - * Gets state. - * - * @return the state - */ - public String getState() - { - return state; - } - /** - * Sets state. - * - * @param state the state - */ - public void setState(String state) - { - this.state = state; - } + @Column(name = "STATE") + private String state; + - /** - * Gets country code. - * - * @return the country code - */ - public String getCountry_code() - { - return country_code; - } - /** - * Sets country code. - * - * @param country_code the country code - */ - public void setCountry_code(String country_code) - { - this.country_code = country_code; - } + @Column(name = "COUNTRY_CODE") + private String countryCode; + - /** - * Gets postal code. - * - * @return the postal code - */ - public String getPostal_code() - { - return postal_code; - } - /** - * Sets postal code. - * - * @param postal_code the postal code - */ - public void setPostal_code(String postal_code) - { - this.postal_code = postal_code; + @Column(name = "POSTAL_CODE") + private String postalCode; + + + + + /** + * Gets the AddressString. + * + * return the AddressString + */ + public String getAddressString() + { + return addressString; + } + + /** + * Sets the AddressString. + * + * @param addressString the AddressString + */ + public void setAddressString(String addressString) + { + this.addressString = addressString; + } + + + /** + * Gets the Locality. + * + * return the Locality + */ + public String getLocality() + { + return locality; + } + + /** + * Sets the Locality. + * + * @param locality the Locality + */ + public void setLocality(String locality) + { + this.locality = locality; + } + + + /** + * Gets the Country. + * + * return the Country + */ + public String getCountry() + { + return country; + } + + /** + * Sets the Country. + * + * @param country the Country + */ + public void setCountry(String country) + { + this.country = country; + } + + + /** + * Gets the City. + * + * return the City + */ + public String getCity() + { + return city; + } + + /** + * Sets the City. + * + * @param city the City + */ + public void setCity(String city) + { + this.city = city; + } + + + /** + * Gets the State. + * + * return the State + */ + public String getState() + { + return state; + } + + /** + * Sets the State. + * + * @param state the State + */ + public void setState(String state) + { + this.state = state; + } + + + /** + * Gets the CountryCode. + * + * return the CountryCode + */ + public String getCountryCode() + { + return countryCode; + } + + /** + * Sets the CountryCode. + * + * @param countryCode the CountryCode + */ + public void setCountryCode(String countryCode) + { + this.countryCode = countryCode; + } + + + /** + * Gets the PostalCode. + * + * return the PostalCode + */ + public String getPostalCode() + { + return postalCode; + } + + /** + * Sets the PostalCode. + * + * @param postalCode the PostalCode + */ + public void setPostalCode(String postalCode) + { + this.postalCode = postalCode; + } + } -} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/ApplicationDisplayPanelVersion.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/ApplicationDisplayPanelVersion.java new file mode 100644 index 000000000..d046d063f --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/ApplicationDisplayPanelVersion.java @@ -0,0 +1,68 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "APPLICATION_DISPLAY_PANEL_VERSIONS", database = TangoDB.class) + public class ApplicationDisplayPanelVersion extends Entity + { + + @Column(name = "VERSION") + private Double version; + + + + @Column(name = "NAME") + private String name; + + + + + /** + * Gets the Version. + * + * return the Version + */ + public Double getVersion() + { + return version; + } + + /** + * Sets the Version. + * + * @param version the Version + */ + public void setVersion(Double version) + { + this.version = version; + } + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/ApplicationFirmwareVersion.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/ApplicationFirmwareVersion.java new file mode 100644 index 000000000..6a417c5c0 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/ApplicationFirmwareVersion.java @@ -0,0 +1,68 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "APPLICATION_FIRMWARE_VERSIONS", database = TangoDB.class) + public class ApplicationFirmwareVersion extends Entity + { + + @Column(name = "VERSION") + private Double version; + + + + @Column(name = "NAME") + private String name; + + + + + /** + * Gets the Version. + * + * return the Version + */ + public Double getVersion() + { + return version; + } + + /** + * Sets the Version. + * + * @param version the Version + */ + public void setVersion(Double version) + { + this.version = version; + } + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/ApplicationOsVersion.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/ApplicationOsVersion.java new file mode 100644 index 000000000..0b443a664 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/ApplicationOsVersion.java @@ -0,0 +1,68 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "APPLICATION_OS_VERSIONS", database = TangoDB.class) + public class ApplicationOsVersion extends Entity + { + + @Column(name = "VERSION") + private Double version; + + + + @Column(name = "NAME") + private String name; + + + + + /** + * Gets the Version. + * + * return the Version + */ + public Double getVersion() + { + return version; + } + + /** + * Sets the Version. + * + * @param version the Version + */ + public void setVersion(Double version) + { + this.version = version; + } + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/ApplicationVersion.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/ApplicationVersion.java new file mode 100644 index 000000000..05c7e75b5 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/ApplicationVersion.java @@ -0,0 +1,68 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "APPLICATION_VERSIONS", database = TangoDB.class) + public class ApplicationVersion extends Entity + { + + @Column(name = "VERSION") + private Double version; + + + + @Column(name = "NAME") + private String name; + + + + + /** + * Gets the Version. + * + * return the Version + */ + public Double getVersion() + { + return version; + } + + /** + * Sets the Version. + * + * @param version the Version + */ + public void setVersion(Double version) + { + this.version = version; + } + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Cartridge.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Cartridge.java new file mode 100644 index 000000000..8bb0deea8 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Cartridge.java @@ -0,0 +1,68 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "CARTRIDGES", database = TangoDB.class) + public class Cartridge extends Entity + { + + @Column(name = "SERIAL_NUMBER") + private String serialNumber; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "CARTRIDGE_TYPE_GUID", foreignKeyColumnName = "GUID")}) + private CartridgeType cartridgeType; + + + + + /** + * Gets the SerialNumber. + * + * return the SerialNumber + */ + public String getSerialNumber() + { + return serialNumber; + } + + /** + * Sets the SerialNumber. + * + * @param serialNumber the SerialNumber + */ + public void setSerialNumber(String serialNumber) + { + this.serialNumber = serialNumber; + } + + + /** + * Gets the CartridgeType. + * + * return the CartridgeType + */ + public CartridgeType getCartridgeType() + { + return cartridgeType; + } + + /** + * Sets the CartridgeType. + * + * @param cartridgeType the CartridgeType + */ + public void setCartridgeType(CartridgeType cartridgeType) + { + this.cartridgeType = cartridgeType; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/CartridgeType.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/CartridgeType.java new file mode 100644 index 000000000..1153665ea --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/CartridgeType.java @@ -0,0 +1,68 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "CARTRIDGE_TYPES", database = TangoDB.class) + public class CartridgeType extends Entity + { + + @Column(name = "CODE") + private int code; + + + + @Column(name = "NAME") + private String name; + + + + + /** + * Gets the Code. + * + * return the Code + */ + public int getCode() + { + return code; + } + + /** + * Sets the Code. + * + * @param code the Code + */ + public void setCode(int code) + { + this.code = code; + } + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Configuration.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Configuration.java new file mode 100644 index 000000000..13aeec266 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Configuration.java @@ -0,0 +1,250 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "CONFIGURATIONS", database = TangoDB.class) + public class Configuration extends Entity + { + + @Column(name = "NAME") + private String name; + + + + @Column(name = "CREATION_DATE") + private DateTime creationDate; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "APPLICATION_DISPLAY_PANEL_VERSION_GUID", foreignKeyColumnName = "GUID")}) + private ApplicationDisplayPanelVersion applicationDisplayPanelVersion; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "APPLICATION_FIRMWARE_VERSION_GUID", foreignKeyColumnName = "GUID")}) + private ApplicationFirmwareVersion applicationFirmwareVersion; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "APPLICATION_OS_VERSION_GUID", foreignKeyColumnName = "GUID")}) + private ApplicationOsVersion applicationOsVersion; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "APPLICATION_VERSION_GUID", foreignKeyColumnName = "GUID")}) + private ApplicationVersion applicationVersion; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "EMBEDDED_FIRMWARE_VERSION_GUID", foreignKeyColumnName = "GUID")}) + private EmbeddedFirmwareVersion embeddedFirmwareVersion; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "EMBEDDED_SOFTWARE_VERSION_GUID", foreignKeyColumnName = "GUID")}) + private EmbeddedSoftwareVersion embeddedSoftwareVersion; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "HARDWARE_VERSION_GUID", foreignKeyColumnName = "GUID")}) + private HardwareVersion hardwareVersion; + + + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Gets the CreationDate. + * + * return the CreationDate + */ + public DateTime getCreationDate() + { + return creationDate; + } + + /** + * Sets the CreationDate. + * + * @param creationDate the CreationDate + */ + public void setCreationDate(DateTime creationDate) + { + this.creationDate = creationDate; + } + + + /** + * Gets the ApplicationDisplayPanelVersion. + * + * return the ApplicationDisplayPanelVersion + */ + public ApplicationDisplayPanelVersion getApplicationDisplayPanelVersion() + { + return applicationDisplayPanelVersion; + } + + /** + * Sets the ApplicationDisplayPanelVersion. + * + * @param applicationDisplayPanelVersion the ApplicationDisplayPanelVersion + */ + public void setApplicationDisplayPanelVersion(ApplicationDisplayPanelVersion applicationDisplayPanelVersion) + { + this.applicationDisplayPanelVersion = applicationDisplayPanelVersion; + } + + + /** + * Gets the ApplicationFirmwareVersion. + * + * return the ApplicationFirmwareVersion + */ + public ApplicationFirmwareVersion getApplicationFirmwareVersion() + { + return applicationFirmwareVersion; + } + + /** + * Sets the ApplicationFirmwareVersion. + * + * @param applicationFirmwareVersion the ApplicationFirmwareVersion + */ + public void setApplicationFirmwareVersion(ApplicationFirmwareVersion applicationFirmwareVersion) + { + this.applicationFirmwareVersion = applicationFirmwareVersion; + } + + + /** + * Gets the ApplicationOsVersion. + * + * return the ApplicationOsVersion + */ + public ApplicationOsVersion getApplicationOsVersion() + { + return applicationOsVersion; + } + + /** + * Sets the ApplicationOsVersion. + * + * @param applicationOsVersion the ApplicationOsVersion + */ + public void setApplicationOsVersion(ApplicationOsVersion applicationOsVersion) + { + this.applicationOsVersion = applicationOsVersion; + } + + + /** + * Gets the ApplicationVersion. + * + * return the ApplicationVersion + */ + public ApplicationVersion getApplicationVersion() + { + return applicationVersion; + } + + /** + * Sets the ApplicationVersion. + * + * @param applicationVersion the ApplicationVersion + */ + public void setApplicationVersion(ApplicationVersion applicationVersion) + { + this.applicationVersion = applicationVersion; + } + + + /** + * Gets the EmbeddedFirmwareVersion. + * + * return the EmbeddedFirmwareVersion + */ + public EmbeddedFirmwareVersion getEmbeddedFirmwareVersion() + { + return embeddedFirmwareVersion; + } + + /** + * Sets the EmbeddedFirmwareVersion. + * + * @param embeddedFirmwareVersion the EmbeddedFirmwareVersion + */ + public void setEmbeddedFirmwareVersion(EmbeddedFirmwareVersion embeddedFirmwareVersion) + { + this.embeddedFirmwareVersion = embeddedFirmwareVersion; + } + + + /** + * Gets the EmbeddedSoftwareVersion. + * + * return the EmbeddedSoftwareVersion + */ + public EmbeddedSoftwareVersion getEmbeddedSoftwareVersion() + { + return embeddedSoftwareVersion; + } + + /** + * Sets the EmbeddedSoftwareVersion. + * + * @param embeddedSoftwareVersion the EmbeddedSoftwareVersion + */ + public void setEmbeddedSoftwareVersion(EmbeddedSoftwareVersion embeddedSoftwareVersion) + { + this.embeddedSoftwareVersion = embeddedSoftwareVersion; + } + + + /** + * Gets the HardwareVersion. + * + * return the HardwareVersion + */ + public HardwareVersion getHardwareVersion() + { + return hardwareVersion; + } + + /** + * Sets the HardwareVersion. + * + * @param hardwareVersion the HardwareVersion + */ + public void setHardwareVersion(HardwareVersion hardwareVersion) + { + this.hardwareVersion = hardwareVersion; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Contact.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Contact.java index a8a1bddac..d4bc21b34 100644 --- a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Contact.java +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Contact.java @@ -1,151 +1,172 @@ package com.twine.tango.dal.entities; import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; import com.twine.tango.dal.TangoDB; -/** - * Represents the DAL Contact entity. - */ -@Table(name = "CONTACTS", database = TangoDB.class) -public class Contact extends Entity -{ - @Column(name = "FIRST_NAME") - private String first_name; - - @Column(name = "LAST_NAME") - private String last_name; - - @Column(name = "FULL_NAME") - private String full_name; - - @Column(name = "EMAIL") - private String email; - - @Column(name = "PHONE_NUMBER") - private String phone_number; - - @Column(name = "FAX") - private String fax; - - /** - * Gets first name. - * - * @return the first name - */ - public String getFirst_name() + @Table(name = "CONTACTS", database = TangoDB.class) + public class Contact extends Entity { - return first_name; - } - /** - * Sets first name. - * - * @param first_name the first name - */ - public void setFirst_name(String first_name) - { - this.first_name = first_name; - } + @Column(name = "FIRST_NAME") + private String firstName; + - /** - * Gets last name. - * - * @return the last name - */ - public String getLast_name() - { - return last_name; - } - /** - * Sets last name. - * - * @param last_name the last name - */ - public void setLast_name(String last_name) - { - this.last_name = last_name; - } + @Column(name = "LAST_NAME") + private String lastName; + - /** - * Gets full name. - * - * @return the full name - */ - public String getFull_name() - { - return full_name; - } - /** - * Sets full name. - * - * @param full_name the full name - */ - public void setFull_name(String full_name) - { - this.full_name = full_name; - } + @Column(name = "FULL_NAME") + private String fullName; + - /** - * Gets email. - * - * @return the email - */ - public String getEmail() - { - return email; - } - /** - * Sets email. - * - * @param email the email - */ - public void setEmail(String email) - { - this.email = email; - } + @Column(name = "EMAIL") + private String email; + - /** - * Gets phone number. - * - * @return the phone number - */ - public String getPhone_number() - { - return phone_number; - } - /** - * Sets phone number. - * - * @param phone_number the phone number - */ - public void setPhone_number(String phone_number) - { - this.phone_number = phone_number; - } + @Column(name = "PHONE_NUMBER") + private String phoneNumber; + - /** - * Gets fax. - * - * @return the fax - */ - public String getFax() - { - return fax; - } - /** - * Sets fax. - * - * @param fax the fax - */ - public void setFax(String fax) - { - this.fax = fax; + @Column(name = "FAX") + private String fax; + + + + + /** + * Gets the FirstName. + * + * return the FirstName + */ + public String getFirstName() + { + return firstName; + } + + /** + * Sets the FirstName. + * + * @param firstName the FirstName + */ + public void setFirstName(String firstName) + { + this.firstName = firstName; + } + + + /** + * Gets the LastName. + * + * return the LastName + */ + public String getLastName() + { + return lastName; + } + + /** + * Sets the LastName. + * + * @param lastName the LastName + */ + public void setLastName(String lastName) + { + this.lastName = lastName; + } + + + /** + * Gets the FullName. + * + * return the FullName + */ + public String getFullName() + { + return fullName; + } + + /** + * Sets the FullName. + * + * @param fullName the FullName + */ + public void setFullName(String fullName) + { + this.fullName = fullName; + } + + + /** + * Gets the Email. + * + * return the Email + */ + public String getEmail() + { + return email; + } + + /** + * Sets the Email. + * + * @param email the Email + */ + public void setEmail(String email) + { + this.email = email; + } + + + /** + * Gets the PhoneNumber. + * + * return the PhoneNumber + */ + public String getPhoneNumber() + { + return phoneNumber; + } + + /** + * Sets the PhoneNumber. + * + * @param phoneNumber the PhoneNumber + */ + public void setPhoneNumber(String phoneNumber) + { + this.phoneNumber = phoneNumber; + } + + + /** + * Gets the Fax. + * + * return the Fax + */ + public String getFax() + { + return fax; + } + + /** + * Sets the Fax. + * + * @param fax the Fax + */ + public void setFax(String fax) + { + this.fax = fax; + } + } -} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/DateConverter.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/DateConverter.java deleted file mode 100644 index 71d5d5301..000000000 --- a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/DateConverter.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.twine.tango.dal.entities; -import com.raizlabs.android.dbflow.converter.TypeConverter; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; - - -/** - * Represents a DBFlow string to date converter used to parse and store SQLite dates. - */ -@com.raizlabs.android.dbflow.annotation.TypeConverter -public class DateConverter extends TypeConverter<String,Date> -{ - - @Override - public String getDBValue(Date model) - { - return android.text.format.DateFormat.format("yyyy-MM-dd hh:mm:ss", model).toString(); - } - - @Override - public Date getModelValue(String data) - { - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - Date date = null; - try - { - date = format.parse(data); - } catch (ParseException e) - { - e.printStackTrace(); - } - return date; - } -} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Dispenser.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Dispenser.java new file mode 100644 index 000000000..a00ae780e --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Dispenser.java @@ -0,0 +1,68 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "DISPENSERS", database = TangoDB.class) + public class Dispenser extends Entity + { + + @Column(name = "SERIAL_NUMBER") + private String serialNumber; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "DISPENSER_TYPE_GUID", foreignKeyColumnName = "GUID")}) + private DispenserType dispenserType; + + + + + /** + * Gets the SerialNumber. + * + * return the SerialNumber + */ + public String getSerialNumber() + { + return serialNumber; + } + + /** + * Sets the SerialNumber. + * + * @param serialNumber the SerialNumber + */ + public void setSerialNumber(String serialNumber) + { + this.serialNumber = serialNumber; + } + + + /** + * Gets the DispenserType. + * + * return the DispenserType + */ + public DispenserType getDispenserType() + { + return dispenserType; + } + + /** + * Sets the DispenserType. + * + * @param dispenserType the DispenserType + */ + public void setDispenserType(DispenserType dispenserType) + { + this.dispenserType = dispenserType; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/DispenserType.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/DispenserType.java new file mode 100644 index 000000000..321ba241b --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/DispenserType.java @@ -0,0 +1,68 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "DISPENSER_TYPES", database = TangoDB.class) + public class DispenserType extends Entity + { + + @Column(name = "CODE") + private int code; + + + + @Column(name = "NAME") + private String name; + + + + + /** + * Gets the Code. + * + * return the Code + */ + public int getCode() + { + return code; + } + + /** + * Sets the Code. + * + * @param code the Code + */ + public void setCode(int code) + { + this.code = code; + } + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/EmbeddedFirmwareVersion.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/EmbeddedFirmwareVersion.java new file mode 100644 index 000000000..9e8a1fe78 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/EmbeddedFirmwareVersion.java @@ -0,0 +1,68 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "EMBEDDED_FIRMWARE_VERSIONS", database = TangoDB.class) + public class EmbeddedFirmwareVersion extends Entity + { + + @Column(name = "VERSION") + private Double version; + + + + @Column(name = "NAME") + private String name; + + + + + /** + * Gets the Version. + * + * return the Version + */ + public Double getVersion() + { + return version; + } + + /** + * Sets the Version. + * + * @param version the Version + */ + public void setVersion(Double version) + { + this.version = version; + } + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/EmbeddedSoftwareVersion.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/EmbeddedSoftwareVersion.java new file mode 100644 index 000000000..1c4d67a2c --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/EmbeddedSoftwareVersion.java @@ -0,0 +1,68 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "EMBEDDED_SOFTWARE_VERSIONS", database = TangoDB.class) + public class EmbeddedSoftwareVersion extends Entity + { + + @Column(name = "VERSION") + private Double version; + + + + @Column(name = "NAME") + private String name; + + + + + /** + * Gets the Version. + * + * return the Version + */ + public Double getVersion() + { + return version; + } + + /** + * Sets the Version. + * + * @param version the Version + */ + public void setVersion(Double version) + { + this.version = version; + } + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Event.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Event.java new file mode 100644 index 000000000..e6c5b562b --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Event.java @@ -0,0 +1,94 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "EVENTS", database = TangoDB.class) + public class Event extends Entity + { + + @Column(name = "CODE") + private int code; + + + + @Column(name = "NAME") + private String name; + + + + @Column(name = "DESCRIPTION") + private String description; + + + + + /** + * Gets the Code. + * + * return the Code + */ + public int getCode() + { + return code; + } + + /** + * Sets the Code. + * + * @param code the Code + */ + public void setCode(int code) + { + this.code = code; + } + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Gets the Description. + * + * return the Description + */ + public String getDescription() + { + return description; + } + + /** + * Sets the Description. + * + * @param description the Description + */ + public void setDescription(String description) + { + this.description = description; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/EventsAction.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/EventsAction.java new file mode 100644 index 000000000..6019137ce --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/EventsAction.java @@ -0,0 +1,68 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "EVENTS_ACTIONS", database = TangoDB.class) + public class EventsAction extends Entity + { + + @ForeignKey(references = { @ForeignKeyReference(columnName = "ACTION_GUID", foreignKeyColumnName = "GUID")}) + private Action action; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "EVENT_GUID", foreignKeyColumnName = "GUID")}) + private Event event; + + + + + /** + * Gets the Action. + * + * return the Action + */ + public Action getAction() + { + return action; + } + + /** + * Sets the Action. + * + * @param action the Action + */ + public void setAction(Action action) + { + this.action = action; + } + + + /** + * Gets the Event. + * + * return the Event + */ + public Event getEvent() + { + return event; + } + + /** + * Sets the Event. + * + * @param event the Event + */ + public void setEvent(Event event) + { + this.event = event; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/FiberShape.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/FiberShape.java new file mode 100644 index 000000000..3005518f6 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/FiberShape.java @@ -0,0 +1,68 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "FIBER_SHAPES", database = TangoDB.class) + public class FiberShape extends Entity + { + + @Column(name = "NAME") + private String name; + + + + @Column(name = "CODE") + private int code; + + + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Gets the Code. + * + * return the Code + */ + public int getCode() + { + return code; + } + + /** + * Sets the Code. + * + * @param code the Code + */ + public void setCode(int code) + { + this.code = code; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/FiberSynth.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/FiberSynth.java new file mode 100644 index 000000000..b1fe190c2 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/FiberSynth.java @@ -0,0 +1,68 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "FIBER_SYNTHS", database = TangoDB.class) + public class FiberSynth extends Entity + { + + @Column(name = "NAME") + private String name; + + + + @Column(name = "CODE") + private int code; + + + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Gets the Code. + * + * return the Code + */ + public int getCode() + { + return code; + } + + /** + * Sets the Code. + * + * @param code the Code + */ + public void setCode(int code) + { + this.code = code; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/HardwareVersion.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/HardwareVersion.java new file mode 100644 index 000000000..a6599f20e --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/HardwareVersion.java @@ -0,0 +1,68 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "HARDWARE_VERSIONS", database = TangoDB.class) + public class HardwareVersion extends Entity + { + + @Column(name = "VERSION") + private Double version; + + + + @Column(name = "NAME") + private String name; + + + + + /** + * Gets the Version. + * + * return the Version + */ + public Double getVersion() + { + return version; + } + + /** + * Sets the Version. + * + * @param version the Version + */ + public void setVersion(Double version) + { + this.version = version; + } + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/IdsPack.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/IdsPack.java new file mode 100644 index 000000000..0bdabfc83 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/IdsPack.java @@ -0,0 +1,146 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "IDS_PACKS", database = TangoDB.class) + public class IdsPack extends Entity + { + + @Column(name = "NAME") + private String name; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "CARTRIDGE_GUID", foreignKeyColumnName = "GUID")}) + private Cartridge cartridge; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "CONFIGURATION_GUID", foreignKeyColumnName = "GUID")}) + private Configuration configuration; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "DISPENSER_GUID", foreignKeyColumnName = "GUID")}) + private Dispenser dispenser; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "LIQUID_GUID", foreignKeyColumnName = "GUID")}) + private Liquid liquid; + + + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Gets the Cartridge. + * + * return the Cartridge + */ + public Cartridge getCartridge() + { + return cartridge; + } + + /** + * Sets the Cartridge. + * + * @param cartridge the Cartridge + */ + public void setCartridge(Cartridge cartridge) + { + this.cartridge = cartridge; + } + + + /** + * Gets the Configuration. + * + * return the Configuration + */ + public Configuration getConfiguration() + { + return configuration; + } + + /** + * Sets the Configuration. + * + * @param configuration the Configuration + */ + public void setConfiguration(Configuration configuration) + { + this.configuration = configuration; + } + + + /** + * Gets the Dispenser. + * + * return the Dispenser + */ + public Dispenser getDispenser() + { + return dispenser; + } + + /** + * Sets the Dispenser. + * + * @param dispenser the Dispenser + */ + public void setDispenser(Dispenser dispenser) + { + this.dispenser = dispenser; + } + + + /** + * Gets the Liquid. + * + * return the Liquid + */ + public Liquid getLiquid() + { + return liquid; + } + + /** + * Sets the Liquid. + * + * @param liquid the Liquid + */ + public void setLiquid(Liquid liquid) + { + this.liquid = liquid; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/LinearMassDensityUnit.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/LinearMassDensityUnit.java new file mode 100644 index 000000000..a88127dd6 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/LinearMassDensityUnit.java @@ -0,0 +1,68 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "LINEAR_MASS_DENSITY_UNITS", database = TangoDB.class) + public class LinearMassDensityUnit extends Entity + { + + @Column(name = "NAME") + private String name; + + + + @Column(name = "CODE") + private int code; + + + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Gets the Code. + * + * return the Code + */ + public int getCode() + { + return code; + } + + /** + * Sets the Code. + * + * @param code the Code + */ + public void setCode(int code) + { + this.code = code; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Liquid.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Liquid.java new file mode 100644 index 000000000..6d43161f7 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Liquid.java @@ -0,0 +1,120 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "LIQUIDS", database = TangoDB.class) + public class Liquid extends Entity + { + + @Column(name = "CODE") + private int code; + + + + @Column(name = "NAME") + private String name; + + + + @Column(name = "VERSION") + private Double version; + + + + @Column(name = "COLOR") + private int color; + + + + + /** + * Gets the Code. + * + * return the Code + */ + public int getCode() + { + return code; + } + + /** + * Sets the Code. + * + * @param code the Code + */ + public void setCode(int code) + { + this.code = code; + } + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Gets the Version. + * + * return the Version + */ + public Double getVersion() + { + return version; + } + + /** + * Sets the Version. + * + * @param version the Version + */ + public void setVersion(Double version) + { + this.version = version; + } + + + /** + * Gets the Color. + * + * return the Color + */ + public int getColor() + { + return color; + } + + /** + * Sets the Color. + * + * @param color the Color + */ + public void setColor(int color) + { + this.color = color; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/LiquidsRml.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/LiquidsRml.java new file mode 100644 index 000000000..ea79f4741 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/LiquidsRml.java @@ -0,0 +1,68 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "LIQUIDS_RMLS", database = TangoDB.class) + public class LiquidsRml extends Entity + { + + @ForeignKey(references = { @ForeignKeyReference(columnName = "LIQUID_GUID", foreignKeyColumnName = "GUID")}) + private Liquid liquid; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "RML_GUID", foreignKeyColumnName = "GUID")}) + private Rml rml; + + + + + /** + * Gets the Liquid. + * + * return the Liquid + */ + public Liquid getLiquid() + { + return liquid; + } + + /** + * Sets the Liquid. + * + * @param liquid the Liquid + */ + public void setLiquid(Liquid liquid) + { + this.liquid = liquid; + } + + + /** + * Gets the Rml. + * + * return the Rml + */ + public Rml getRml() + { + return rml; + } + + /** + * Sets the Rml. + * + * @param rml the Rml + */ + public void setRml(Rml rml) + { + this.rml = rml; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Machine.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Machine.java new file mode 100644 index 000000000..d91a1d4cf --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Machine.java @@ -0,0 +1,146 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "MACHINES", database = TangoDB.class) + public class Machine extends Entity + { + + @Column(name = "SERIAL_NUMBER") + private String serialNumber; + + + + @Column(name = "NAME") + private String name; + + + + @Column(name = "PRODUCTION_DATE") + private DateTime productionDate; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "MACHINE_VERSION_GUID", foreignKeyColumnName = "GUID")}) + private MachineVersion machineVersion; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "ORGANIZATION_GUID", foreignKeyColumnName = "GUID")}) + private Organization organization; + + + + + /** + * Gets the SerialNumber. + * + * return the SerialNumber + */ + public String getSerialNumber() + { + return serialNumber; + } + + /** + * Sets the SerialNumber. + * + * @param serialNumber the SerialNumber + */ + public void setSerialNumber(String serialNumber) + { + this.serialNumber = serialNumber; + } + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Gets the ProductionDate. + * + * return the ProductionDate + */ + public DateTime getProductionDate() + { + return productionDate; + } + + /** + * Sets the ProductionDate. + * + * @param productionDate the ProductionDate + */ + public void setProductionDate(DateTime productionDate) + { + this.productionDate = productionDate; + } + + + /** + * Gets the MachineVersion. + * + * return the MachineVersion + */ + public MachineVersion getMachineVersion() + { + return machineVersion; + } + + /** + * Sets the MachineVersion. + * + * @param machineVersion the MachineVersion + */ + public void setMachineVersion(MachineVersion machineVersion) + { + this.machineVersion = machineVersion; + } + + + /** + * Gets the Organization. + * + * return the Organization + */ + public Organization getOrganization() + { + return organization; + } + + /** + * Sets the Organization. + * + * @param organization the Organization + */ + public void setOrganization(Organization organization) + { + this.organization = organization; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/MachineVersion.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/MachineVersion.java new file mode 100644 index 000000000..832428f73 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/MachineVersion.java @@ -0,0 +1,94 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "MACHINE_VERSIONS", database = TangoDB.class) + public class MachineVersion extends Entity + { + + @Column(name = "VERSION") + private Double version; + + + + @Column(name = "NAME") + private String name; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "CONFIGURATION_GUID", foreignKeyColumnName = "GUID")}) + private Configuration configuration; + + + + + /** + * Gets the Version. + * + * return the Version + */ + public Double getVersion() + { + return version; + } + + /** + * Sets the Version. + * + * @param version the Version + */ + public void setVersion(Double version) + { + this.version = version; + } + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Gets the Configuration. + * + * return the Configuration + */ + public Configuration getConfiguration() + { + return configuration; + } + + /** + * Sets the Configuration. + * + * @param configuration the Configuration + */ + public void setConfiguration(Configuration configuration) + { + this.configuration = configuration; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/MachinesConfiguration.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/MachinesConfiguration.java new file mode 100644 index 000000000..1325eb93a --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/MachinesConfiguration.java @@ -0,0 +1,68 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "MACHINES_CONFIGURATIONS", database = TangoDB.class) + public class MachinesConfiguration extends Entity + { + + @ForeignKey(references = { @ForeignKeyReference(columnName = "CONFIGURATION_GUID", foreignKeyColumnName = "GUID")}) + private Configuration configuration; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "MACHINE_GUID", foreignKeyColumnName = "GUID")}) + private Machine machine; + + + + + /** + * Gets the Configuration. + * + * return the Configuration + */ + public Configuration getConfiguration() + { + return configuration; + } + + /** + * Sets the Configuration. + * + * @param configuration the Configuration + */ + public void setConfiguration(Configuration configuration) + { + this.configuration = configuration; + } + + + /** + * Gets the Machine. + * + * return the Machine + */ + public Machine getMachine() + { + return machine; + } + + /** + * Sets the Machine. + * + * @param machine the Machine + */ + public void setMachine(Machine machine) + { + this.machine = machine; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/MachinesEvent.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/MachinesEvent.java new file mode 100644 index 000000000..15b55c35c --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/MachinesEvent.java @@ -0,0 +1,146 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "MACHINES_EVENTS", database = TangoDB.class) + public class MachinesEvent extends Entity + { + + @Column(name = "DATE_TIME") + private DateTime dateTime; + + + + @Column(name = "DESCRIPTION") + private String description; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "EVENT_GUID", foreignKeyColumnName = "GUID")}) + private Event event; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "MACHINE_GUID", foreignKeyColumnName = "GUID")}) + private Machine machine; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "USER_GUID", foreignKeyColumnName = "GUID")}) + private User user; + + + + + /** + * Gets the DateTime. + * + * return the DateTime + */ + public DateTime getDateTime() + { + return dateTime; + } + + /** + * Sets the DateTime. + * + * @param dateTime the DateTime + */ + public void setDateTime(DateTime dateTime) + { + this.dateTime = dateTime; + } + + + /** + * Gets the Description. + * + * return the Description + */ + public String getDescription() + { + return description; + } + + /** + * Sets the Description. + * + * @param description the Description + */ + public void setDescription(String description) + { + this.description = description; + } + + + /** + * Gets the Event. + * + * return the Event + */ + public Event getEvent() + { + return event; + } + + /** + * Sets the Event. + * + * @param event the Event + */ + public void setEvent(Event event) + { + this.event = event; + } + + + /** + * Gets the Machine. + * + * return the Machine + */ + public Machine getMachine() + { + return machine; + } + + /** + * Sets the Machine. + * + * @param machine the Machine + */ + public void setMachine(Machine machine) + { + this.machine = machine; + } + + + /** + * Gets the User. + * + * return the User + */ + public User getUser() + { + return user; + } + + /** + * Sets the User. + * + * @param user the User + */ + public void setUser(User user) + { + this.user = user; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/MediaColor.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/MediaColor.java new file mode 100644 index 000000000..1410a87e5 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/MediaColor.java @@ -0,0 +1,42 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "MEDIA_COLORS", database = TangoDB.class) + public class MediaColor extends Entity + { + + @Column(name = "COLOR") + private int color; + + + + + /** + * Gets the Color. + * + * return the Color + */ + public int getColor() + { + return color; + } + + /** + * Sets the Color. + * + * @param color the Color + */ + public void setColor(int color) + { + this.color = color; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/MediaCondition.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/MediaCondition.java new file mode 100644 index 000000000..405eb81b4 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/MediaCondition.java @@ -0,0 +1,68 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "MEDIA_CONDITIONS", database = TangoDB.class) + public class MediaCondition extends Entity + { + + @Column(name = "NAME") + private String name; + + + + @Column(name = "CODE") + private int code; + + + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Gets the Code. + * + * return the Code + */ + public int getCode() + { + return code; + } + + /** + * Sets the Code. + * + * @param code the Code + */ + public void setCode(int code) + { + this.code = code; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/MediaMaterial.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/MediaMaterial.java new file mode 100644 index 000000000..2b3e4a333 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/MediaMaterial.java @@ -0,0 +1,68 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "MEDIA_MATERIALS", database = TangoDB.class) + public class MediaMaterial extends Entity + { + + @Column(name = "NAME") + private String name; + + + + @Column(name = "CODE") + private int code; + + + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Gets the Code. + * + * return the Code + */ + public int getCode() + { + return code; + } + + /** + * Sets the Code. + * + * @param code the Code + */ + public void setCode(int code) + { + this.code = code; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/MediaPurpose.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/MediaPurpose.java new file mode 100644 index 000000000..e2e8f81b7 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/MediaPurpose.java @@ -0,0 +1,68 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "MEDIA_PURPOSES", database = TangoDB.class) + public class MediaPurpose extends Entity + { + + @Column(name = "NAME") + private String name; + + + + @Column(name = "CODE") + private int code; + + + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Gets the Code. + * + * return the Code + */ + public int getCode() + { + return code; + } + + /** + * Sets the Code. + * + * @param code the Code + */ + public void setCode(int code) + { + this.code = code; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Organization.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Organization.java index 870b80ad3..4cc0e0955 100644 --- a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Organization.java +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Organization.java @@ -4,81 +4,91 @@ import com.raizlabs.android.dbflow.annotation.Column; import com.raizlabs.android.dbflow.annotation.ForeignKey; import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; import com.twine.tango.dal.TangoDB; -/** - * Represents the DAL Organization entity. - */ -@Table(name = "ORGANIZATIONS", database = TangoDB.class) -public class Organization extends Entity -{ - @Column(name = "NAME") - private String name; - - @ForeignKey(references = {@ForeignKeyReference(columnName = "CONTACT_GUID", foreignKeyColumnName = "GUID")}) - private Contact contact; - - @ForeignKey(references = {@ForeignKeyReference(columnName = "ADDRESS_GUID", foreignKeyColumnName = "GUID")}) - private Address address; - - /** - * Gets name. - * - * @return the name - */ - public String getName() + @Table(name = "ORGANIZATIONS", database = TangoDB.class) + public class Organization extends Entity { - return name; - } - /** - * Sets name. - * - * @param name the name - */ - public void setName(String name) - { - this.name = name; - } + @Column(name = "NAME") + private String name; + - /** - * Gets contact. - * - * @return the contact - */ - public Contact getContact() - { - return contact; - } - /** - * Sets contact. - * - * @param contact the contact - */ - public void setContact(Contact contact) - { - this.contact = contact; - } + @ForeignKey(references = { @ForeignKeyReference(columnName = "ADDRESS_GUID", foreignKeyColumnName = "GUID")}) + private Address address; + - /** - * Gets address. - * - * @return the address - */ - public Address getAddress() - { - return address; - } - /** - * Sets address. - * - * @param address the address - */ - public void setAddress(Address address) - { - this.address = address; + @ForeignKey(references = { @ForeignKeyReference(columnName = "CONTACT_GUID", foreignKeyColumnName = "GUID")}) + private Contact contact; + + + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Gets the Address. + * + * return the Address + */ + public Address getAddress() + { + return address; + } + + /** + * Sets the Address. + * + * @param address the Address + */ + public void setAddress(Address address) + { + this.address = address; + } + + + /** + * Gets the Contact. + * + * return the Contact + */ + public Contact getContact() + { + return contact; + } + + /** + * Sets the Contact. + * + * @param contact the Contact + */ + public void setContact(Contact contact) + { + this.contact = contact; + } + } -} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Permission.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Permission.java new file mode 100644 index 000000000..993ca374e --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Permission.java @@ -0,0 +1,94 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "PERMISSIONS", database = TangoDB.class) + public class Permission extends Entity + { + + @Column(name = "CODE") + private int code; + + + + @Column(name = "NAME") + private String name; + + + + @Column(name = "DESCRIPTION") + private String description; + + + + + /** + * Gets the Code. + * + * return the Code + */ + public int getCode() + { + return code; + } + + /** + * Sets the Code. + * + * @param code the Code + */ + public void setCode(int code) + { + this.code = code; + } + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Gets the Description. + * + * return the Description + */ + public String getDescription() + { + return description; + } + + /** + * Sets the Description. + * + * @param description the Description + */ + public void setDescription(String description) + { + this.description = description; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Rml.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Rml.java new file mode 100644 index 000000000..5f7fe528d --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Rml.java @@ -0,0 +1,484 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "RMLS", database = TangoDB.class) + public class Rml extends Entity + { + + @Column(name = "MANUFACTURER") + private String manufacturer; + + + + @Column(name = "FIBER_SIZE") + private Double fiberSize; + + + + @Column(name = "NUMBER_OF_FIBER") + private int numberOfFiber; + + + + @Column(name = "PLIES_PER_FIBER") + private int pliesPerFiber; + + + + @Column(name = "PLIES_PER_THREAD") + private int pliesPerThread; + + + + @Column(name = "TWISTED") + private Boolean twisted; + + + + @Column(name = "AIR_ENTANGLEMENT") + private Boolean airEntanglement; + + + + @Column(name = "LUBRICANT") + private Boolean lubricant; + + + + @Column(name = "TENSILE_STRENGTH") + private Double tensileStrength; + + + + @Column(name = "ELONGATION_AT_BREAK_PERCENTAGE") + private Double elongationAtBreakPercentage; + + + + @Column(name = "ESTIMATED_THREAD_DIAMETER") + private Double estimatedThreadDiameter; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "FIBER_SHAPE_GUID", foreignKeyColumnName = "GUID")}) + private FiberShape fiberShape; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "FIBER_SYNTH_GUID", foreignKeyColumnName = "GUID")}) + private FiberSynth fiberSynth; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "LINEAR_MASS_DENSITY_UNIT_GUID", foreignKeyColumnName = "GUID")}) + private LinearMassDensityUnit linearMassDensityUnit; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "MEDIA_COLOR_GUID", foreignKeyColumnName = "GUID")}) + private MediaColor mediaColor; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "MEDIA_CONDITION_GUID", foreignKeyColumnName = "GUID")}) + private MediaCondition mediaCondition; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "MEDIA_MATERIAL_GUID", foreignKeyColumnName = "GUID")}) + private MediaMaterial mediaMaterial; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "MEDIA_PURPOSE_GUID", foreignKeyColumnName = "GUID")}) + private MediaPurpose mediaPurpose; + + + + + /** + * Gets the Manufacturer. + * + * return the Manufacturer + */ + public String getManufacturer() + { + return manufacturer; + } + + /** + * Sets the Manufacturer. + * + * @param manufacturer the Manufacturer + */ + public void setManufacturer(String manufacturer) + { + this.manufacturer = manufacturer; + } + + + /** + * Gets the FiberSize. + * + * return the FiberSize + */ + public Double getFiberSize() + { + return fiberSize; + } + + /** + * Sets the FiberSize. + * + * @param fiberSize the FiberSize + */ + public void setFiberSize(Double fiberSize) + { + this.fiberSize = fiberSize; + } + + + /** + * Gets the NumberOfFiber. + * + * return the NumberOfFiber + */ + public int getNumberOfFiber() + { + return numberOfFiber; + } + + /** + * Sets the NumberOfFiber. + * + * @param numberOfFiber the NumberOfFiber + */ + public void setNumberOfFiber(int numberOfFiber) + { + this.numberOfFiber = numberOfFiber; + } + + + /** + * Gets the PliesPerFiber. + * + * return the PliesPerFiber + */ + public int getPliesPerFiber() + { + return pliesPerFiber; + } + + /** + * Sets the PliesPerFiber. + * + * @param pliesPerFiber the PliesPerFiber + */ + public void setPliesPerFiber(int pliesPerFiber) + { + this.pliesPerFiber = pliesPerFiber; + } + + + /** + * Gets the PliesPerThread. + * + * return the PliesPerThread + */ + public int getPliesPerThread() + { + return pliesPerThread; + } + + /** + * Sets the PliesPerThread. + * + * @param pliesPerThread the PliesPerThread + */ + public void setPliesPerThread(int pliesPerThread) + { + this.pliesPerThread = pliesPerThread; + } + + + /** + * Gets the Twisted. + * + * return the Twisted + */ + public Boolean isTwisted() + { + return twisted; + } + + /** + * Sets the Twisted. + * + * @param twisted the Twisted + */ + public void setTwisted(Boolean twisted) + { + this.twisted = twisted; + } + + + /** + * Gets the AirEntanglement. + * + * return the AirEntanglement + */ + public Boolean isAirEntanglement() + { + return airEntanglement; + } + + /** + * Sets the AirEntanglement. + * + * @param airEntanglement the AirEntanglement + */ + public void setAirEntanglement(Boolean airEntanglement) + { + this.airEntanglement = airEntanglement; + } + + + /** + * Gets the Lubricant. + * + * return the Lubricant + */ + public Boolean isLubricant() + { + return lubricant; + } + + /** + * Sets the Lubricant. + * + * @param lubricant the Lubricant + */ + public void setLubricant(Boolean lubricant) + { + this.lubricant = lubricant; + } + + + /** + * Gets the TensileStrength. + * + * return the TensileStrength + */ + public Double getTensileStrength() + { + return tensileStrength; + } + + /** + * Sets the TensileStrength. + * + * @param tensileStrength the TensileStrength + */ + public void setTensileStrength(Double tensileStrength) + { + this.tensileStrength = tensileStrength; + } + + + /** + * Gets the ElongationAtBreakPercentage. + * + * return the ElongationAtBreakPercentage + */ + public Double getElongationAtBreakPercentage() + { + return elongationAtBreakPercentage; + } + + /** + * Sets the ElongationAtBreakPercentage. + * + * @param elongationAtBreakPercentage the ElongationAtBreakPercentage + */ + public void setElongationAtBreakPercentage(Double elongationAtBreakPercentage) + { + this.elongationAtBreakPercentage = elongationAtBreakPercentage; + } + + + /** + * Gets the EstimatedThreadDiameter. + * + * return the EstimatedThreadDiameter + */ + public Double getEstimatedThreadDiameter() + { + return estimatedThreadDiameter; + } + + /** + * Sets the EstimatedThreadDiameter. + * + * @param estimatedThreadDiameter the EstimatedThreadDiameter + */ + public void setEstimatedThreadDiameter(Double estimatedThreadDiameter) + { + this.estimatedThreadDiameter = estimatedThreadDiameter; + } + + + /** + * Gets the FiberShape. + * + * return the FiberShape + */ + public FiberShape getFiberShape() + { + return fiberShape; + } + + /** + * Sets the FiberShape. + * + * @param fiberShape the FiberShape + */ + public void setFiberShape(FiberShape fiberShape) + { + this.fiberShape = fiberShape; + } + + + /** + * Gets the FiberSynth. + * + * return the FiberSynth + */ + public FiberSynth getFiberSynth() + { + return fiberSynth; + } + + /** + * Sets the FiberSynth. + * + * @param fiberSynth the FiberSynth + */ + public void setFiberSynth(FiberSynth fiberSynth) + { + this.fiberSynth = fiberSynth; + } + + + /** + * Gets the LinearMassDensityUnit. + * + * return the LinearMassDensityUnit + */ + public LinearMassDensityUnit getLinearMassDensityUnit() + { + return linearMassDensityUnit; + } + + /** + * Sets the LinearMassDensityUnit. + * + * @param linearMassDensityUnit the LinearMassDensityUnit + */ + public void setLinearMassDensityUnit(LinearMassDensityUnit linearMassDensityUnit) + { + this.linearMassDensityUnit = linearMassDensityUnit; + } + + + /** + * Gets the MediaColor. + * + * return the MediaColor + */ + public MediaColor getMediaColor() + { + return mediaColor; + } + + /** + * Sets the MediaColor. + * + * @param mediaColor the MediaColor + */ + public void setMediaColor(MediaColor mediaColor) + { + this.mediaColor = mediaColor; + } + + + /** + * Gets the MediaCondition. + * + * return the MediaCondition + */ + public MediaCondition getMediaCondition() + { + return mediaCondition; + } + + /** + * Sets the MediaCondition. + * + * @param mediaCondition the MediaCondition + */ + public void setMediaCondition(MediaCondition mediaCondition) + { + this.mediaCondition = mediaCondition; + } + + + /** + * Gets the MediaMaterial. + * + * return the MediaMaterial + */ + public MediaMaterial getMediaMaterial() + { + return mediaMaterial; + } + + /** + * Sets the MediaMaterial. + * + * @param mediaMaterial the MediaMaterial + */ + public void setMediaMaterial(MediaMaterial mediaMaterial) + { + this.mediaMaterial = mediaMaterial; + } + + + /** + * Gets the MediaPurpose. + * + * return the MediaPurpose + */ + public MediaPurpose getMediaPurpose() + { + return mediaPurpose; + } + + /** + * Sets the MediaPurpose. + * + * @param mediaPurpose the MediaPurpose + */ + public void setMediaPurpose(MediaPurpose mediaPurpose) + { + this.mediaPurpose = mediaPurpose; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Role.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Role.java new file mode 100644 index 000000000..67af86526 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/Role.java @@ -0,0 +1,94 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "ROLES", database = TangoDB.class) + public class Role extends Entity + { + + @Column(name = "CODE") + private int code; + + + + @Column(name = "NAME") + private String name; + + + + @Column(name = "DESCRIPTION") + private String description; + + + + + /** + * Gets the Code. + * + * return the Code + */ + public int getCode() + { + return code; + } + + /** + * Sets the Code. + * + * @param code the Code + */ + public void setCode(int code) + { + this.code = code; + } + + + /** + * Gets the Name. + * + * return the Name + */ + public String getName() + { + return name; + } + + /** + * Sets the Name. + * + * @param name the Name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Gets the Description. + * + * return the Description + */ + public String getDescription() + { + return description; + } + + /** + * Sets the Description. + * + * @param description the Description + */ + public void setDescription(String description) + { + this.description = description; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/RolesPermission.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/RolesPermission.java new file mode 100644 index 000000000..6fe88c192 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/RolesPermission.java @@ -0,0 +1,68 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "ROLES_PERMISSIONS", database = TangoDB.class) + public class RolesPermission extends Entity + { + + @ForeignKey(references = { @ForeignKeyReference(columnName = "PERMISSION_GUID", foreignKeyColumnName = "GUID")}) + private Permission permission; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "ROLE_GUID", foreignKeyColumnName = "GUID")}) + private Role role; + + + + + /** + * Gets the Permission. + * + * return the Permission + */ + public Permission getPermission() + { + return permission; + } + + /** + * Sets the Permission. + * + * @param permission the Permission + */ + public void setPermission(Permission permission) + { + this.permission = permission; + } + + + /** + * Gets the Role. + * + * return the Role + */ + public Role getRole() + { + return role; + } + + /** + * Sets the Role. + * + * @param role the Role + */ + public void setRole(Role role) + { + this.role = role; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/SyncConfiguration.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/SyncConfiguration.java new file mode 100644 index 000000000..e4f95db71 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/SyncConfiguration.java @@ -0,0 +1,16 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "SYNC_CONFIGURATIONS", database = TangoDB.class) + public class SyncConfiguration extends Entity + { + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/User.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/User.java new file mode 100644 index 000000000..5a346a620 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/User.java @@ -0,0 +1,146 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "USERS", database = TangoDB.class) + public class User extends Entity + { + + @Column(name = "EMAIL") + private String email; + + + + @Column(name = "PASSWORD") + private String password; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "ADDRESS_GUID", foreignKeyColumnName = "GUID")}) + private Address address; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "CONTACT_GUID", foreignKeyColumnName = "GUID")}) + private Contact contact; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "ORGANIZATION_GUID", foreignKeyColumnName = "GUID")}) + private Organization organization; + + + + + /** + * Gets the Email. + * + * return the Email + */ + public String getEmail() + { + return email; + } + + /** + * Sets the Email. + * + * @param email the Email + */ + public void setEmail(String email) + { + this.email = email; + } + + + /** + * Gets the Password. + * + * return the Password + */ + public String getPassword() + { + return password; + } + + /** + * Sets the Password. + * + * @param password the Password + */ + public void setPassword(String password) + { + this.password = password; + } + + + /** + * Gets the Address. + * + * return the Address + */ + public Address getAddress() + { + return address; + } + + /** + * Sets the Address. + * + * @param address the Address + */ + public void setAddress(Address address) + { + this.address = address; + } + + + /** + * Gets the Contact. + * + * return the Contact + */ + public Contact getContact() + { + return contact; + } + + /** + * Sets the Contact. + * + * @param contact the Contact + */ + public void setContact(Contact contact) + { + this.contact = contact; + } + + + /** + * Gets the Organization. + * + * return the Organization + */ + public Organization getOrganization() + { + return organization; + } + + /** + * Sets the Organization. + * + * @param organization the Organization + */ + public void setOrganization(Organization organization) + { + this.organization = organization; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/UsersRole.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/UsersRole.java new file mode 100644 index 000000000..ad1c44bd1 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/entities/UsersRole.java @@ -0,0 +1,68 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @Table(name = "USERS_ROLES", database = TangoDB.class) + public class UsersRole extends Entity + { + + @ForeignKey(references = { @ForeignKeyReference(columnName = "ROLE_GUID", foreignKeyColumnName = "GUID")}) + private Role role; + + + + @ForeignKey(references = { @ForeignKeyReference(columnName = "USER_GUID", foreignKeyColumnName = "GUID")}) + private User user; + + + + + /** + * Gets the Role. + * + * return the Role + */ + public Role getRole() + { + return role; + } + + /** + * Sets the Role. + * + * @param role the Role + */ + public void setRole(Role role) + { + this.role = role; + } + + + /** + * Gets the User. + * + * return the User + */ + public User getUser() + { + return user; + } + + /** + * Sets the User. + * + * @param user the User + */ + public void setUser(User user) + { + this.user = user; + } + + } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Actions.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Actions.java new file mode 100644 index 000000000..55eebeb78 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Actions.java @@ -0,0 +1,15 @@ +package com.twine.tango.dal.enumerations; + +import com.twine.tango.core.DescriptionAnnotation; + +public enum Actions +{ + ; + + private int value; + + Actions(int value) + { + this.value = value; + } +} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/CartridgeTypes.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/CartridgeTypes.java new file mode 100644 index 000000000..7be6a56e6 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/CartridgeTypes.java @@ -0,0 +1,19 @@ +package com.twine.tango.dal.enumerations; + +import com.twine.tango.core.DescriptionAnnotation; + +public enum CartridgeTypes +{ + + @DescriptionAnnotation(description = "Cartridge 1") + Cartridge1(1), + + ; + + private int value; + + CartridgeTypes(int value) + { + this.value = value; + } +} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/DispenserTypes.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/DispenserTypes.java new file mode 100644 index 000000000..dc6ccf001 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/DispenserTypes.java @@ -0,0 +1,19 @@ +package com.twine.tango.dal.enumerations; + +import com.twine.tango.core.DescriptionAnnotation; + +public enum DispenserTypes +{ + + @DescriptionAnnotation(description = "Dispenser 1") + Dispenser1(1), + + ; + + private int value; + + DispenserTypes(int value) + { + this.value = value; + } +} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/EnumDemo.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/EnumDemo.java new file mode 100644 index 000000000..a92d6aefa --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/EnumDemo.java @@ -0,0 +1,20 @@ +package com.twine.tango.dal.enumerations; + +import com.twine.tango.core.DescriptionAnnotation; + +public enum EnumDemo +{ + @DescriptionAnnotation(description = "Hi") + PENNY(1), + NICKLE(5), + DIME(10), + QUARTER(25); + + + private int value; + + EnumDemo(int value) + { + this.value = value; + } +} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Events.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Events.java new file mode 100644 index 000000000..bfa2e1758 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Events.java @@ -0,0 +1,15 @@ +package com.twine.tango.dal.enumerations; + +import com.twine.tango.core.DescriptionAnnotation; + +public enum Events +{ + ; + + private int value; + + Events(int value) + { + this.value = value; + } +} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/FiberShapes.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/FiberShapes.java new file mode 100644 index 000000000..d146cd79a --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/FiberShapes.java @@ -0,0 +1,15 @@ +package com.twine.tango.dal.enumerations; + +import com.twine.tango.core.DescriptionAnnotation; + +public enum FiberShapes +{ + ; + + private int value; + + FiberShapes(int value) + { + this.value = value; + } +} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/FiberSynths.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/FiberSynths.java new file mode 100644 index 000000000..0b8b6384d --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/FiberSynths.java @@ -0,0 +1,15 @@ +package com.twine.tango.dal.enumerations; + +import com.twine.tango.core.DescriptionAnnotation; + +public enum FiberSynths +{ + ; + + private int value; + + FiberSynths(int value) + { + this.value = value; + } +} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/LinearMassDensityUnits.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/LinearMassDensityUnits.java new file mode 100644 index 000000000..495a187f1 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/LinearMassDensityUnits.java @@ -0,0 +1,15 @@ +package com.twine.tango.dal.enumerations; + +import com.twine.tango.core.DescriptionAnnotation; + +public enum LinearMassDensityUnits +{ + ; + + private int value; + + LinearMassDensityUnits(int value) + { + this.value = value; + } +} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Liquids.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Liquids.java new file mode 100644 index 000000000..ca82d56ad --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Liquids.java @@ -0,0 +1,22 @@ +package com.twine.tango.dal.enumerations; + +import com.twine.tango.core.DescriptionAnnotation; + +public enum Liquids +{ + + @DescriptionAnnotation(description = "Cyan") + Cyan(1), + + @DescriptionAnnotation(description = "Magenta") + Magenta(2), + + ; + + private int value; + + Liquids(int value) + { + this.value = value; + } +} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/MediaConditions.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/MediaConditions.java new file mode 100644 index 000000000..7fc83ad16 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/MediaConditions.java @@ -0,0 +1,15 @@ +package com.twine.tango.dal.enumerations; + +import com.twine.tango.core.DescriptionAnnotation; + +public enum MediaConditions +{ + ; + + private int value; + + MediaConditions(int value) + { + this.value = value; + } +} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/MediaMaterials.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/MediaMaterials.java new file mode 100644 index 000000000..ca2b458af --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/MediaMaterials.java @@ -0,0 +1,15 @@ +package com.twine.tango.dal.enumerations; + +import com.twine.tango.core.DescriptionAnnotation; + +public enum MediaMaterials +{ + ; + + private int value; + + MediaMaterials(int value) + { + this.value = value; + } +} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/MediaPurposes.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/MediaPurposes.java new file mode 100644 index 000000000..8cf72e8e0 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/MediaPurposes.java @@ -0,0 +1,15 @@ +package com.twine.tango.dal.enumerations; + +import com.twine.tango.core.DescriptionAnnotation; + +public enum MediaPurposes +{ + ; + + private int value; + + MediaPurposes(int value) + { + this.value = value; + } +} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Permissions.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Permissions.java new file mode 100644 index 000000000..cb3cc1c56 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Permissions.java @@ -0,0 +1,25 @@ +package com.twine.tango.dal.enumerations; + +import com.twine.tango.core.DescriptionAnnotation; + +public enum Permissions +{ + + @DescriptionAnnotation(description = "Allows loading the technician module in Machine Studio") + RunTechnicianModule(0), + + @DescriptionAnnotation(description = "Allows loading the developer module in Machine Studio") + RunDeveloperModule(1), + + @DescriptionAnnotation(description = "Allows loading the database module in Machine Studio") + RunDataBaseModule(2), + + ; + + private int value; + + Permissions(int value) + { + this.value = value; + } +} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Roles.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Roles.java new file mode 100644 index 000000000..8be545370 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Roles.java @@ -0,0 +1,31 @@ +package com.twine.tango.dal.enumerations; + +import com.twine.tango.core.DescriptionAnnotation; + +public enum Roles +{ + + @DescriptionAnnotation(description = "User with standard permissions") + User(0), + + @DescriptionAnnotation(description = "Twine administrator") + Administrator(1), + + @DescriptionAnnotation(description = "Twine technician") + Technician(2), + + @DescriptionAnnotation(description = "Twine Research and development") + Developer(3), + + @DescriptionAnnotation(description = "Role Description") + SomeRole(4), + + ; + + private int value; + + Roles(int value) + { + this.value = value; + } +} diff --git a/Software/Android_Studio/Tango.DAL/src/main/res/raw/tangodb b/Software/Android_Studio/Tango.DAL/src/main/res/raw/tangodb Binary files differindex f27e1a63f..277930e15 100644 --- a/Software/Android_Studio/Tango.DAL/src/main/res/raw/tangodb +++ b/Software/Android_Studio/Tango.DAL/src/main/res/raw/tangodb diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/common/ErrorCodeOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/common/ErrorCodeOuterClass.java new file mode 100644 index 000000000..935c1071f --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/common/ErrorCodeOuterClass.java @@ -0,0 +1,143 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ErrorCode.proto + +package com.twine.tango.pmr.common; + +public final class ErrorCodeOuterClass { + private ErrorCodeOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code Tango.PMR.Common.ErrorCode} + */ + public enum ErrorCode + implements com.google.protobuf.ProtocolMessageEnum { + /** + * <code>NONE = 0;</code> + */ + NONE(0), + /** + * <code>BAD_CRC = 1;</code> + */ + BAD_CRC(1), + UNRECOGNIZED(-1), + ; + + /** + * <code>NONE = 0;</code> + */ + public static final int NONE_VALUE = 0; + /** + * <code>BAD_CRC = 1;</code> + */ + public static final int BAD_CRC_VALUE = 1; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ErrorCode valueOf(int value) { + return forNumber(value); + } + + public static ErrorCode forNumber(int value) { + switch (value) { + case 0: return NONE; + case 1: return BAD_CRC; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap<ErrorCode> + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ErrorCode> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap<ErrorCode>() { + public ErrorCode findValueByNumber(int number) { + return ErrorCode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.twine.tango.pmr.common.ErrorCodeOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final ErrorCode[] VALUES = values(); + + public static ErrorCode valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ErrorCode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:Tango.PMR.Common.ErrorCode) + } + + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\017ErrorCode.proto\022\020Tango.PMR.Common*\"\n\tE" + + "rrorCode\022\010\n\004NONE\020\000\022\013\n\007BAD_CRC\020\001B\034\n\032com.t" + + "wine.tango.pmr.commonb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/common/MessageContainerOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/common/MessageContainerOuterClass.java index c4919dae3..fe9919195 100644 --- a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/common/MessageContainerOuterClass.java +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/common/MessageContainerOuterClass.java @@ -51,6 +51,20 @@ public final class MessageContainerOuterClass { * <code>bytes Data = 5;</code> */ com.google.protobuf.ByteString getData(); + + /** + * <code>uint32 CRC = 6;</code> + */ + int getCRC(); + + /** + * <code>.Tango.PMR.Common.ErrorCode Error = 7;</code> + */ + int getErrorValue(); + /** + * <code>.Tango.PMR.Common.ErrorCode Error = 7;</code> + */ + com.twine.tango.pmr.common.ErrorCodeOuterClass.ErrorCode getError(); } /** * Protobuf type {@code Tango.PMR.Common.MessageContainer} @@ -70,6 +84,8 @@ public final class MessageContainerOuterClass { continuous_ = false; completed_ = false; data_ = com.google.protobuf.ByteString.EMPTY; + cRC_ = 0; + error_ = 0; } @java.lang.Override @@ -127,6 +143,17 @@ public final class MessageContainerOuterClass { data_ = input.readBytes(); break; } + case 48: { + + cRC_ = input.readUInt32(); + break; + } + case 56: { + int rawValue = input.readEnum(); + + error_ = rawValue; + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -228,6 +255,31 @@ public final class MessageContainerOuterClass { return data_; } + public static final int CRC_FIELD_NUMBER = 6; + private int cRC_; + /** + * <code>uint32 CRC = 6;</code> + */ + public int getCRC() { + return cRC_; + } + + public static final int ERROR_FIELD_NUMBER = 7; + private int error_; + /** + * <code>.Tango.PMR.Common.ErrorCode Error = 7;</code> + */ + public int getErrorValue() { + return error_; + } + /** + * <code>.Tango.PMR.Common.ErrorCode Error = 7;</code> + */ + public com.twine.tango.pmr.common.ErrorCodeOuterClass.ErrorCode getError() { + com.twine.tango.pmr.common.ErrorCodeOuterClass.ErrorCode result = com.twine.tango.pmr.common.ErrorCodeOuterClass.ErrorCode.valueOf(error_); + return result == null ? com.twine.tango.pmr.common.ErrorCodeOuterClass.ErrorCode.UNRECOGNIZED : result; + } + private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; @@ -255,6 +307,12 @@ public final class MessageContainerOuterClass { if (!data_.isEmpty()) { output.writeBytes(5, data_); } + if (cRC_ != 0) { + output.writeUInt32(6, cRC_); + } + if (error_ != com.twine.tango.pmr.common.ErrorCodeOuterClass.ErrorCode.NONE.getNumber()) { + output.writeEnum(7, error_); + } unknownFields.writeTo(output); } @@ -282,6 +340,14 @@ public final class MessageContainerOuterClass { size += com.google.protobuf.CodedOutputStream .computeBytesSize(5, data_); } + if (cRC_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(6, cRC_); + } + if (error_ != com.twine.tango.pmr.common.ErrorCodeOuterClass.ErrorCode.NONE.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(7, error_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -307,6 +373,9 @@ public final class MessageContainerOuterClass { == other.getCompleted()); result = result && getData() .equals(other.getData()); + result = result && (getCRC() + == other.getCRC()); + result = result && error_ == other.error_; result = result && unknownFields.equals(other.unknownFields); return result; } @@ -330,6 +399,10 @@ public final class MessageContainerOuterClass { getCompleted()); hash = (37 * hash) + DATA_FIELD_NUMBER; hash = (53 * hash) + getData().hashCode(); + hash = (37 * hash) + CRC_FIELD_NUMBER; + hash = (53 * hash) + getCRC(); + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + error_; hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -469,6 +542,10 @@ public final class MessageContainerOuterClass { data_ = com.google.protobuf.ByteString.EMPTY; + cRC_ = 0; + + error_ = 0; + return this; } @@ -496,6 +573,8 @@ public final class MessageContainerOuterClass { result.continuous_ = continuous_; result.completed_ = completed_; result.data_ = data_; + result.cRC_ = cRC_; + result.error_ = error_; onBuilt(); return result; } @@ -553,6 +632,12 @@ public final class MessageContainerOuterClass { if (other.getData() != com.google.protobuf.ByteString.EMPTY) { setData(other.getData()); } + if (other.getCRC() != 0) { + setCRC(other.getCRC()); + } + if (other.error_ != 0) { + setErrorValue(other.getErrorValue()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -773,6 +858,76 @@ public final class MessageContainerOuterClass { onChanged(); return this; } + + private int cRC_ ; + /** + * <code>uint32 CRC = 6;</code> + */ + public int getCRC() { + return cRC_; + } + /** + * <code>uint32 CRC = 6;</code> + */ + public Builder setCRC(int value) { + + cRC_ = value; + onChanged(); + return this; + } + /** + * <code>uint32 CRC = 6;</code> + */ + public Builder clearCRC() { + + cRC_ = 0; + onChanged(); + return this; + } + + private int error_ = 0; + /** + * <code>.Tango.PMR.Common.ErrorCode Error = 7;</code> + */ + public int getErrorValue() { + return error_; + } + /** + * <code>.Tango.PMR.Common.ErrorCode Error = 7;</code> + */ + public Builder setErrorValue(int value) { + error_ = value; + onChanged(); + return this; + } + /** + * <code>.Tango.PMR.Common.ErrorCode Error = 7;</code> + */ + public com.twine.tango.pmr.common.ErrorCodeOuterClass.ErrorCode getError() { + com.twine.tango.pmr.common.ErrorCodeOuterClass.ErrorCode result = com.twine.tango.pmr.common.ErrorCodeOuterClass.ErrorCode.valueOf(error_); + return result == null ? com.twine.tango.pmr.common.ErrorCodeOuterClass.ErrorCode.UNRECOGNIZED : result; + } + /** + * <code>.Tango.PMR.Common.ErrorCode Error = 7;</code> + */ + public Builder setError(com.twine.tango.pmr.common.ErrorCodeOuterClass.ErrorCode value) { + if (value == null) { + throw new NullPointerException(); + } + + error_ = value.getNumber(); + onChanged(); + return this; + } + /** + * <code>.Tango.PMR.Common.ErrorCode Error = 7;</code> + */ + public Builder clearError() { + + error_ = 0; + onChanged(); + return this; + } public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFieldsProto3(unknownFields); @@ -837,11 +992,13 @@ public final class MessageContainerOuterClass { static { java.lang.String[] descriptorData = { "\n\026MessageContainer.proto\022\020Tango.PMR.Comm" + - "on\032\021MessageType.proto\"\203\001\n\020MessageContain" + - "er\022+\n\004Type\030\001 \001(\0162\035.Tango.PMR.Common.Mess" + - "ageType\022\r\n\005Token\030\002 \001(\t\022\022\n\nContinuous\030\003 \001" + - "(\010\022\021\n\tCompleted\030\004 \001(\010\022\014\n\004Data\030\005 \001(\014B\034\n\032c" + - "om.twine.tango.pmr.commonb\006proto3" + "on\032\021MessageType.proto\032\017ErrorCode.proto\"\274" + + "\001\n\020MessageContainer\022+\n\004Type\030\001 \001(\0162\035.Tang" + + "o.PMR.Common.MessageType\022\r\n\005Token\030\002 \001(\t\022" + + "\022\n\nContinuous\030\003 \001(\010\022\021\n\tCompleted\030\004 \001(\010\022\014" + + "\n\004Data\030\005 \001(\014\022\013\n\003CRC\030\006 \001(\r\022*\n\005Error\030\007 \001(\016" + + "2\033.Tango.PMR.Common.ErrorCodeB\034\n\032com.twi" + + "ne.tango.pmr.commonb\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -855,14 +1012,16 @@ public final class MessageContainerOuterClass { .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { com.twine.tango.pmr.common.MessageTypeOuterClass.getDescriptor(), + com.twine.tango.pmr.common.ErrorCodeOuterClass.getDescriptor(), }, assigner); internal_static_Tango_PMR_Common_MessageContainer_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_Tango_PMR_Common_MessageContainer_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_Tango_PMR_Common_MessageContainer_descriptor, - new java.lang.String[] { "Type", "Token", "Continuous", "Completed", "Data", }); + new java.lang.String[] { "Type", "Token", "Continuous", "Completed", "Data", "CRC", "Error", }); com.twine.tango.pmr.common.MessageTypeOuterClass.getDescriptor(); + com.twine.tango.pmr.common.ErrorCodeOuterClass.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/common/MessageTypeOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/common/MessageTypeOuterClass.java index 45185ab6d..a58b36456 100644 --- a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/common/MessageTypeOuterClass.java +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/common/MessageTypeOuterClass.java @@ -47,6 +47,102 @@ public final class MessageTypeOuterClass { * <code>ProgressResponse = 6;</code> */ ProgressResponse(6), + /** + * <code>StubCartridgeReadRequest = 7;</code> + */ + StubCartridgeReadRequest(7), + /** + * <code>StubCartridgeReadResponse = 8;</code> + */ + StubCartridgeReadResponse(8), + /** + * <code>StubCartridgeWriteRequest = 9;</code> + */ + StubCartridgeWriteRequest(9), + /** + * <code>StubCartridgeWriteResponse = 10;</code> + */ + StubCartridgeWriteResponse(10), + /** + * <code>StubDispenserRequest = 11;</code> + */ + StubDispenserRequest(11), + /** + * <code>StubDispenserResponse = 12;</code> + */ + StubDispenserResponse(12), + /** + * <code>StubGPIOReadBitRequest = 13;</code> + */ + StubGPIOReadBitRequest(13), + /** + * <code>StubGPIOReadBitResponse = 14;</code> + */ + StubGPIOReadBitResponse(14), + /** + * <code>StubGPIOReadByteRequest = 15;</code> + */ + StubGPIOReadByteRequest(15), + /** + * <code>StubGPIOReadByteResponse = 16;</code> + */ + StubGPIOReadByteResponse(16), + /** + * <code>StubGPIOWriteBitRequest = 17;</code> + */ + StubGPIOWriteBitRequest(17), + /** + * <code>StubGPIOWriteBitResponse = 18;</code> + */ + StubGPIOWriteBitResponse(18), + /** + * <code>StubGPIOWriteByteRequest = 19;</code> + */ + StubGPIOWriteByteRequest(19), + /** + * <code>StubGPIOWriteByteResponse = 20;</code> + */ + StubGPIOWriteByteResponse(20), + /** + * <code>StubHeaterRequest = 21;</code> + */ + StubHeaterRequest(21), + /** + * <code>StubHeaterResponse = 22;</code> + */ + StubHeaterResponse(22), + /** + * <code>StubMotorEncoderRequest = 23;</code> + */ + StubMotorEncoderRequest(23), + /** + * <code>StubMotorEncoderResponse = 24;</code> + */ + StubMotorEncoderResponse(24), + /** + * <code>StubOptLimitSwitchRequest = 25;</code> + */ + StubOptLimitSwitchRequest(25), + /** + * <code>StubOptLimitSwitchResponse = 26;</code> + */ + StubOptLimitSwitchResponse(26), + /** + * <code>StubSteperMotorRequest = 27;</code> + */ + StubSteperMotorRequest(27), + /** + * <code>StubSteperMotorResponse = 28;</code> + */ + StubSteperMotorResponse(28), + /** + * <code>StubValveRequest = 29;</code> + */ + StubValveRequest(29), + /** + * <code>StubValveResponse = 30;</code> + */ + StubValveResponse(30), UNRECOGNIZED(-1), ; @@ -78,6 +174,102 @@ public final class MessageTypeOuterClass { * <code>ProgressResponse = 6;</code> */ public static final int ProgressResponse_VALUE = 6; + /** + * <code>StubCartridgeReadRequest = 7;</code> + */ + public static final int StubCartridgeReadRequest_VALUE = 7; + /** + * <code>StubCartridgeReadResponse = 8;</code> + */ + public static final int StubCartridgeReadResponse_VALUE = 8; + /** + * <code>StubCartridgeWriteRequest = 9;</code> + */ + public static final int StubCartridgeWriteRequest_VALUE = 9; + /** + * <code>StubCartridgeWriteResponse = 10;</code> + */ + public static final int StubCartridgeWriteResponse_VALUE = 10; + /** + * <code>StubDispenserRequest = 11;</code> + */ + public static final int StubDispenserRequest_VALUE = 11; + /** + * <code>StubDispenserResponse = 12;</code> + */ + public static final int StubDispenserResponse_VALUE = 12; + /** + * <code>StubGPIOReadBitRequest = 13;</code> + */ + public static final int StubGPIOReadBitRequest_VALUE = 13; + /** + * <code>StubGPIOReadBitResponse = 14;</code> + */ + public static final int StubGPIOReadBitResponse_VALUE = 14; + /** + * <code>StubGPIOReadByteRequest = 15;</code> + */ + public static final int StubGPIOReadByteRequest_VALUE = 15; + /** + * <code>StubGPIOReadByteResponse = 16;</code> + */ + public static final int StubGPIOReadByteResponse_VALUE = 16; + /** + * <code>StubGPIOWriteBitRequest = 17;</code> + */ + public static final int StubGPIOWriteBitRequest_VALUE = 17; + /** + * <code>StubGPIOWriteBitResponse = 18;</code> + */ + public static final int StubGPIOWriteBitResponse_VALUE = 18; + /** + * <code>StubGPIOWriteByteRequest = 19;</code> + */ + public static final int StubGPIOWriteByteRequest_VALUE = 19; + /** + * <code>StubGPIOWriteByteResponse = 20;</code> + */ + public static final int StubGPIOWriteByteResponse_VALUE = 20; + /** + * <code>StubHeaterRequest = 21;</code> + */ + public static final int StubHeaterRequest_VALUE = 21; + /** + * <code>StubHeaterResponse = 22;</code> + */ + public static final int StubHeaterResponse_VALUE = 22; + /** + * <code>StubMotorEncoderRequest = 23;</code> + */ + public static final int StubMotorEncoderRequest_VALUE = 23; + /** + * <code>StubMotorEncoderResponse = 24;</code> + */ + public static final int StubMotorEncoderResponse_VALUE = 24; + /** + * <code>StubOptLimitSwitchRequest = 25;</code> + */ + public static final int StubOptLimitSwitchRequest_VALUE = 25; + /** + * <code>StubOptLimitSwitchResponse = 26;</code> + */ + public static final int StubOptLimitSwitchResponse_VALUE = 26; + /** + * <code>StubSteperMotorRequest = 27;</code> + */ + public static final int StubSteperMotorRequest_VALUE = 27; + /** + * <code>StubSteperMotorResponse = 28;</code> + */ + public static final int StubSteperMotorResponse_VALUE = 28; + /** + * <code>StubValveRequest = 29;</code> + */ + public static final int StubValveRequest_VALUE = 29; + /** + * <code>StubValveResponse = 30;</code> + */ + public static final int StubValveResponse_VALUE = 30; public final int getNumber() { @@ -105,6 +297,30 @@ public final class MessageTypeOuterClass { case 4: return CalculateResponse; case 5: return ProgressRequest; case 6: return ProgressResponse; + case 7: return StubCartridgeReadRequest; + case 8: return StubCartridgeReadResponse; + case 9: return StubCartridgeWriteRequest; + case 10: return StubCartridgeWriteResponse; + case 11: return StubDispenserRequest; + case 12: return StubDispenserResponse; + case 13: return StubGPIOReadBitRequest; + case 14: return StubGPIOReadBitResponse; + case 15: return StubGPIOReadByteRequest; + case 16: return StubGPIOReadByteResponse; + case 17: return StubGPIOWriteBitRequest; + case 18: return StubGPIOWriteBitResponse; + case 19: return StubGPIOWriteByteRequest; + case 20: return StubGPIOWriteByteResponse; + case 21: return StubHeaterRequest; + case 22: return StubHeaterResponse; + case 23: return StubMotorEncoderRequest; + case 24: return StubMotorEncoderResponse; + case 25: return StubOptLimitSwitchRequest; + case 26: return StubOptLimitSwitchResponse; + case 27: return StubSteperMotorRequest; + case 28: return StubSteperMotorResponse; + case 29: return StubValveRequest; + case 30: return StubValveResponse; default: return null; } } @@ -166,12 +382,29 @@ public final class MessageTypeOuterClass { descriptor; static { java.lang.String[] descriptorData = { - "\n\021MessageType.proto\022\020Tango.PMR.Common*\204\001" + + "\n\021MessageType.proto\022\020Tango.PMR.Common*\260\006" + "\n\013MessageType\022\007\n\003RGB\020\000\022\007\n\003Job\020\001\022\013\n\007Segme" + "nt\020\002\022\024\n\020CalculateRequest\020\003\022\025\n\021CalculateR" + "esponse\020\004\022\023\n\017ProgressRequest\020\005\022\024\n\020Progre" + - "ssResponse\020\006B\034\n\032com.twine.tango.pmr.comm" + - "onb\006proto3" + "ssResponse\020\006\022\034\n\030StubCartridgeReadRequest" + + "\020\007\022\035\n\031StubCartridgeReadResponse\020\010\022\035\n\031Stu" + + "bCartridgeWriteRequest\020\t\022\036\n\032StubCartridg" + + "eWriteResponse\020\n\022\030\n\024StubDispenserRequest" + + "\020\013\022\031\n\025StubDispenserResponse\020\014\022\032\n\026StubGPI" + + "OReadBitRequest\020\r\022\033\n\027StubGPIOReadBitResp", + "onse\020\016\022\033\n\027StubGPIOReadByteRequest\020\017\022\034\n\030S" + + "tubGPIOReadByteResponse\020\020\022\033\n\027StubGPIOWri" + + "teBitRequest\020\021\022\034\n\030StubGPIOWriteBitRespon" + + "se\020\022\022\034\n\030StubGPIOWriteByteRequest\020\023\022\035\n\031St" + + "ubGPIOWriteByteResponse\020\024\022\025\n\021StubHeaterR" + + "equest\020\025\022\026\n\022StubHeaterResponse\020\026\022\033\n\027Stub" + + "MotorEncoderRequest\020\027\022\034\n\030StubMotorEncode" + + "rResponse\020\030\022\035\n\031StubOptLimitSwitchRequest" + + "\020\031\022\036\n\032StubOptLimitSwitchResponse\020\032\022\032\n\026St" + + "ubSteperMotorRequest\020\033\022\033\n\027StubSteperMoto", + "rResponse\020\034\022\024\n\020StubValveRequest\020\035\022\025\n\021Stu" + + "bValveResponse\020\036B\034\n\032com.twine.tango.pmr." + + "commonb\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubCartridgeReadRequestOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubCartridgeReadRequestOuterClass.java new file mode 100644 index 000000000..baed0890f --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubCartridgeReadRequestOuterClass.java @@ -0,0 +1,525 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubCartridgeReadRequest.proto + +package com.twine.tango.pmr.stubs; + +public final class StubCartridgeReadRequestOuterClass { + private StubCartridgeReadRequestOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubCartridgeReadRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubCartridgeReadRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * <pre> + *0..7 + * </pre> + * + * <code>uint32 CartridgeId = 1;</code> + */ + int getCartridgeId(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubCartridgeReadRequest} + */ + public static final class StubCartridgeReadRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubCartridgeReadRequest) + StubCartridgeReadRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubCartridgeReadRequest.newBuilder() to construct. + private StubCartridgeReadRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubCartridgeReadRequest() { + cartridgeId_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubCartridgeReadRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + cartridgeId_ = input.readUInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.internal_static_Tango_PMR_Stubs_StubCartridgeReadRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.internal_static_Tango_PMR_Stubs_StubCartridgeReadRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest.class, com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest.Builder.class); + } + + public static final int CARTRIDGEID_FIELD_NUMBER = 1; + private int cartridgeId_; + /** + * <pre> + *0..7 + * </pre> + * + * <code>uint32 CartridgeId = 1;</code> + */ + public int getCartridgeId() { + return cartridgeId_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (cartridgeId_ != 0) { + output.writeUInt32(1, cartridgeId_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (cartridgeId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, cartridgeId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest other = (com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest) obj; + + boolean result = true; + result = result && (getCartridgeId() + == other.getCartridgeId()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CARTRIDGEID_FIELD_NUMBER; + hash = (53 * hash) + getCartridgeId(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubCartridgeReadRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubCartridgeReadRequest) + com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.internal_static_Tango_PMR_Stubs_StubCartridgeReadRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.internal_static_Tango_PMR_Stubs_StubCartridgeReadRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest.class, com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + cartridgeId_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.internal_static_Tango_PMR_Stubs_StubCartridgeReadRequest_descriptor; + } + + public com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest build() { + com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest buildPartial() { + com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest result = new com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest(this); + result.cartridgeId_ = cartridgeId_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest) { + return mergeFrom((com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest other) { + if (other == com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest.getDefaultInstance()) return this; + if (other.getCartridgeId() != 0) { + setCartridgeId(other.getCartridgeId()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int cartridgeId_ ; + /** + * <pre> + *0..7 + * </pre> + * + * <code>uint32 CartridgeId = 1;</code> + */ + public int getCartridgeId() { + return cartridgeId_; + } + /** + * <pre> + *0..7 + * </pre> + * + * <code>uint32 CartridgeId = 1;</code> + */ + public Builder setCartridgeId(int value) { + + cartridgeId_ = value; + onChanged(); + return this; + } + /** + * <pre> + *0..7 + * </pre> + * + * <code>uint32 CartridgeId = 1;</code> + */ + public Builder clearCartridgeId() { + + cartridgeId_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubCartridgeReadRequest) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubCartridgeReadRequest) + private static final com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest(); + } + + public static com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubCartridgeReadRequest> + PARSER = new com.google.protobuf.AbstractParser<StubCartridgeReadRequest>() { + public StubCartridgeReadRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubCartridgeReadRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubCartridgeReadRequest> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubCartridgeReadRequest> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubCartridgeReadRequestOuterClass.StubCartridgeReadRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubCartridgeReadRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubCartridgeReadRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\036StubCartridgeReadRequest.proto\022\017Tango." + + "PMR.Stubs\"/\n\030StubCartridgeReadRequest\022\023\n" + + "\013CartridgeId\030\001 \001(\rB\033\n\031com.twine.tango.pm" + + "r.stubsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubCartridgeReadRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubCartridgeReadRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubCartridgeReadRequest_descriptor, + new java.lang.String[] { "CartridgeId", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubCartridgeReadResponseOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubCartridgeReadResponseOuterClass.java new file mode 100644 index 000000000..eb7fd4cb6 --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubCartridgeReadResponseOuterClass.java @@ -0,0 +1,824 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubCartridgeReadResponse.proto + +package com.twine.tango.pmr.stubs; + +public final class StubCartridgeReadResponseOuterClass { + private StubCartridgeReadResponseOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubCartridgeReadResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubCartridgeReadResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>uint32 CartridgeId = 1;</code> + */ + int getCartridgeId(); + + /** + * <code>uint32 CartridgeColor = 3;</code> + */ + int getCartridgeColor(); + + /** + * <code>uint32 CartridgeVersion = 4;</code> + */ + int getCartridgeVersion(); + + /** + * <code>uint32 CartridgeData = 5;</code> + */ + int getCartridgeData(); + + /** + * <code>bool CartridgeUsed = 6;</code> + */ + boolean getCartridgeUsed(); + + /** + * <code>uint32 Status = 8;</code> + */ + int getStatus(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubCartridgeReadResponse} + */ + public static final class StubCartridgeReadResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubCartridgeReadResponse) + StubCartridgeReadResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubCartridgeReadResponse.newBuilder() to construct. + private StubCartridgeReadResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubCartridgeReadResponse() { + cartridgeId_ = 0; + cartridgeColor_ = 0; + cartridgeVersion_ = 0; + cartridgeData_ = 0; + cartridgeUsed_ = false; + status_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubCartridgeReadResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + cartridgeId_ = input.readUInt32(); + break; + } + case 24: { + + cartridgeColor_ = input.readUInt32(); + break; + } + case 32: { + + cartridgeVersion_ = input.readUInt32(); + break; + } + case 40: { + + cartridgeData_ = input.readUInt32(); + break; + } + case 48: { + + cartridgeUsed_ = input.readBool(); + break; + } + case 64: { + + status_ = input.readUInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.internal_static_Tango_PMR_Stubs_StubCartridgeReadResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.internal_static_Tango_PMR_Stubs_StubCartridgeReadResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse.class, com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse.Builder.class); + } + + public static final int CARTRIDGEID_FIELD_NUMBER = 1; + private int cartridgeId_; + /** + * <code>uint32 CartridgeId = 1;</code> + */ + public int getCartridgeId() { + return cartridgeId_; + } + + public static final int CARTRIDGECOLOR_FIELD_NUMBER = 3; + private int cartridgeColor_; + /** + * <code>uint32 CartridgeColor = 3;</code> + */ + public int getCartridgeColor() { + return cartridgeColor_; + } + + public static final int CARTRIDGEVERSION_FIELD_NUMBER = 4; + private int cartridgeVersion_; + /** + * <code>uint32 CartridgeVersion = 4;</code> + */ + public int getCartridgeVersion() { + return cartridgeVersion_; + } + + public static final int CARTRIDGEDATA_FIELD_NUMBER = 5; + private int cartridgeData_; + /** + * <code>uint32 CartridgeData = 5;</code> + */ + public int getCartridgeData() { + return cartridgeData_; + } + + public static final int CARTRIDGEUSED_FIELD_NUMBER = 6; + private boolean cartridgeUsed_; + /** + * <code>bool CartridgeUsed = 6;</code> + */ + public boolean getCartridgeUsed() { + return cartridgeUsed_; + } + + public static final int STATUS_FIELD_NUMBER = 8; + private int status_; + /** + * <code>uint32 Status = 8;</code> + */ + public int getStatus() { + return status_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (cartridgeId_ != 0) { + output.writeUInt32(1, cartridgeId_); + } + if (cartridgeColor_ != 0) { + output.writeUInt32(3, cartridgeColor_); + } + if (cartridgeVersion_ != 0) { + output.writeUInt32(4, cartridgeVersion_); + } + if (cartridgeData_ != 0) { + output.writeUInt32(5, cartridgeData_); + } + if (cartridgeUsed_ != false) { + output.writeBool(6, cartridgeUsed_); + } + if (status_ != 0) { + output.writeUInt32(8, status_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (cartridgeId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, cartridgeId_); + } + if (cartridgeColor_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, cartridgeColor_); + } + if (cartridgeVersion_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, cartridgeVersion_); + } + if (cartridgeData_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(5, cartridgeData_); + } + if (cartridgeUsed_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(6, cartridgeUsed_); + } + if (status_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(8, status_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse other = (com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse) obj; + + boolean result = true; + result = result && (getCartridgeId() + == other.getCartridgeId()); + result = result && (getCartridgeColor() + == other.getCartridgeColor()); + result = result && (getCartridgeVersion() + == other.getCartridgeVersion()); + result = result && (getCartridgeData() + == other.getCartridgeData()); + result = result && (getCartridgeUsed() + == other.getCartridgeUsed()); + result = result && (getStatus() + == other.getStatus()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CARTRIDGEID_FIELD_NUMBER; + hash = (53 * hash) + getCartridgeId(); + hash = (37 * hash) + CARTRIDGECOLOR_FIELD_NUMBER; + hash = (53 * hash) + getCartridgeColor(); + hash = (37 * hash) + CARTRIDGEVERSION_FIELD_NUMBER; + hash = (53 * hash) + getCartridgeVersion(); + hash = (37 * hash) + CARTRIDGEDATA_FIELD_NUMBER; + hash = (53 * hash) + getCartridgeData(); + hash = (37 * hash) + CARTRIDGEUSED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getCartridgeUsed()); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubCartridgeReadResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubCartridgeReadResponse) + com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.internal_static_Tango_PMR_Stubs_StubCartridgeReadResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.internal_static_Tango_PMR_Stubs_StubCartridgeReadResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse.class, com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + cartridgeId_ = 0; + + cartridgeColor_ = 0; + + cartridgeVersion_ = 0; + + cartridgeData_ = 0; + + cartridgeUsed_ = false; + + status_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.internal_static_Tango_PMR_Stubs_StubCartridgeReadResponse_descriptor; + } + + public com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse build() { + com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse buildPartial() { + com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse result = new com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse(this); + result.cartridgeId_ = cartridgeId_; + result.cartridgeColor_ = cartridgeColor_; + result.cartridgeVersion_ = cartridgeVersion_; + result.cartridgeData_ = cartridgeData_; + result.cartridgeUsed_ = cartridgeUsed_; + result.status_ = status_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse) { + return mergeFrom((com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse other) { + if (other == com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse.getDefaultInstance()) return this; + if (other.getCartridgeId() != 0) { + setCartridgeId(other.getCartridgeId()); + } + if (other.getCartridgeColor() != 0) { + setCartridgeColor(other.getCartridgeColor()); + } + if (other.getCartridgeVersion() != 0) { + setCartridgeVersion(other.getCartridgeVersion()); + } + if (other.getCartridgeData() != 0) { + setCartridgeData(other.getCartridgeData()); + } + if (other.getCartridgeUsed() != false) { + setCartridgeUsed(other.getCartridgeUsed()); + } + if (other.getStatus() != 0) { + setStatus(other.getStatus()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int cartridgeId_ ; + /** + * <code>uint32 CartridgeId = 1;</code> + */ + public int getCartridgeId() { + return cartridgeId_; + } + /** + * <code>uint32 CartridgeId = 1;</code> + */ + public Builder setCartridgeId(int value) { + + cartridgeId_ = value; + onChanged(); + return this; + } + /** + * <code>uint32 CartridgeId = 1;</code> + */ + public Builder clearCartridgeId() { + + cartridgeId_ = 0; + onChanged(); + return this; + } + + private int cartridgeColor_ ; + /** + * <code>uint32 CartridgeColor = 3;</code> + */ + public int getCartridgeColor() { + return cartridgeColor_; + } + /** + * <code>uint32 CartridgeColor = 3;</code> + */ + public Builder setCartridgeColor(int value) { + + cartridgeColor_ = value; + onChanged(); + return this; + } + /** + * <code>uint32 CartridgeColor = 3;</code> + */ + public Builder clearCartridgeColor() { + + cartridgeColor_ = 0; + onChanged(); + return this; + } + + private int cartridgeVersion_ ; + /** + * <code>uint32 CartridgeVersion = 4;</code> + */ + public int getCartridgeVersion() { + return cartridgeVersion_; + } + /** + * <code>uint32 CartridgeVersion = 4;</code> + */ + public Builder setCartridgeVersion(int value) { + + cartridgeVersion_ = value; + onChanged(); + return this; + } + /** + * <code>uint32 CartridgeVersion = 4;</code> + */ + public Builder clearCartridgeVersion() { + + cartridgeVersion_ = 0; + onChanged(); + return this; + } + + private int cartridgeData_ ; + /** + * <code>uint32 CartridgeData = 5;</code> + */ + public int getCartridgeData() { + return cartridgeData_; + } + /** + * <code>uint32 CartridgeData = 5;</code> + */ + public Builder setCartridgeData(int value) { + + cartridgeData_ = value; + onChanged(); + return this; + } + /** + * <code>uint32 CartridgeData = 5;</code> + */ + public Builder clearCartridgeData() { + + cartridgeData_ = 0; + onChanged(); + return this; + } + + private boolean cartridgeUsed_ ; + /** + * <code>bool CartridgeUsed = 6;</code> + */ + public boolean getCartridgeUsed() { + return cartridgeUsed_; + } + /** + * <code>bool CartridgeUsed = 6;</code> + */ + public Builder setCartridgeUsed(boolean value) { + + cartridgeUsed_ = value; + onChanged(); + return this; + } + /** + * <code>bool CartridgeUsed = 6;</code> + */ + public Builder clearCartridgeUsed() { + + cartridgeUsed_ = false; + onChanged(); + return this; + } + + private int status_ ; + /** + * <code>uint32 Status = 8;</code> + */ + public int getStatus() { + return status_; + } + /** + * <code>uint32 Status = 8;</code> + */ + public Builder setStatus(int value) { + + status_ = value; + onChanged(); + return this; + } + /** + * <code>uint32 Status = 8;</code> + */ + public Builder clearStatus() { + + status_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubCartridgeReadResponse) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubCartridgeReadResponse) + private static final com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse(); + } + + public static com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubCartridgeReadResponse> + PARSER = new com.google.protobuf.AbstractParser<StubCartridgeReadResponse>() { + public StubCartridgeReadResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubCartridgeReadResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubCartridgeReadResponse> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubCartridgeReadResponse> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubCartridgeReadResponseOuterClass.StubCartridgeReadResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubCartridgeReadResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubCartridgeReadResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\037StubCartridgeReadResponse.proto\022\017Tango" + + ".PMR.Stubs\"\240\001\n\031StubCartridgeReadResponse" + + "\022\023\n\013CartridgeId\030\001 \001(\r\022\026\n\016CartridgeColor\030" + + "\003 \001(\r\022\030\n\020CartridgeVersion\030\004 \001(\r\022\025\n\rCartr" + + "idgeData\030\005 \001(\r\022\025\n\rCartridgeUsed\030\006 \001(\010\022\016\n" + + "\006Status\030\010 \001(\rB\033\n\031com.twine.tango.pmr.stu" + + "bsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubCartridgeReadResponse_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubCartridgeReadResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubCartridgeReadResponse_descriptor, + new java.lang.String[] { "CartridgeId", "CartridgeColor", "CartridgeVersion", "CartridgeData", "CartridgeUsed", "Status", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubCartridgeWriteRequestOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubCartridgeWriteRequestOuterClass.java new file mode 100644 index 000000000..d379d450b --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubCartridgeWriteRequestOuterClass.java @@ -0,0 +1,815 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubCartridgeWriteRequest.proto + +package com.twine.tango.pmr.stubs; + +public final class StubCartridgeWriteRequestOuterClass { + private StubCartridgeWriteRequestOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubCartridgeWriteRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubCartridgeWriteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * <pre> + *0..7 + * </pre> + * + * <code>uint32 CartridgeId = 1;</code> + */ + int getCartridgeId(); + + /** + * <pre> + * </pre> + * + * <code>uint32 CartridgeColor = 2;</code> + */ + int getCartridgeColor(); + + /** + * <code>uint32 CartridgeVersion = 3;</code> + */ + int getCartridgeVersion(); + + /** + * <code>uint32 CartridgeData = 4;</code> + */ + int getCartridgeData(); + + /** + * <pre> + * 0 - new 1- used + * </pre> + * + * <code>bool CartridgeUsed = 5;</code> + */ + boolean getCartridgeUsed(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubCartridgeWriteRequest} + */ + public static final class StubCartridgeWriteRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubCartridgeWriteRequest) + StubCartridgeWriteRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubCartridgeWriteRequest.newBuilder() to construct. + private StubCartridgeWriteRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubCartridgeWriteRequest() { + cartridgeId_ = 0; + cartridgeColor_ = 0; + cartridgeVersion_ = 0; + cartridgeData_ = 0; + cartridgeUsed_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubCartridgeWriteRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + cartridgeId_ = input.readUInt32(); + break; + } + case 16: { + + cartridgeColor_ = input.readUInt32(); + break; + } + case 24: { + + cartridgeVersion_ = input.readUInt32(); + break; + } + case 32: { + + cartridgeData_ = input.readUInt32(); + break; + } + case 40: { + + cartridgeUsed_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.internal_static_Tango_PMR_Stubs_StubCartridgeWriteRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.internal_static_Tango_PMR_Stubs_StubCartridgeWriteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest.class, com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest.Builder.class); + } + + public static final int CARTRIDGEID_FIELD_NUMBER = 1; + private int cartridgeId_; + /** + * <pre> + *0..7 + * </pre> + * + * <code>uint32 CartridgeId = 1;</code> + */ + public int getCartridgeId() { + return cartridgeId_; + } + + public static final int CARTRIDGECOLOR_FIELD_NUMBER = 2; + private int cartridgeColor_; + /** + * <pre> + * </pre> + * + * <code>uint32 CartridgeColor = 2;</code> + */ + public int getCartridgeColor() { + return cartridgeColor_; + } + + public static final int CARTRIDGEVERSION_FIELD_NUMBER = 3; + private int cartridgeVersion_; + /** + * <code>uint32 CartridgeVersion = 3;</code> + */ + public int getCartridgeVersion() { + return cartridgeVersion_; + } + + public static final int CARTRIDGEDATA_FIELD_NUMBER = 4; + private int cartridgeData_; + /** + * <code>uint32 CartridgeData = 4;</code> + */ + public int getCartridgeData() { + return cartridgeData_; + } + + public static final int CARTRIDGEUSED_FIELD_NUMBER = 5; + private boolean cartridgeUsed_; + /** + * <pre> + * 0 - new 1- used + * </pre> + * + * <code>bool CartridgeUsed = 5;</code> + */ + public boolean getCartridgeUsed() { + return cartridgeUsed_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (cartridgeId_ != 0) { + output.writeUInt32(1, cartridgeId_); + } + if (cartridgeColor_ != 0) { + output.writeUInt32(2, cartridgeColor_); + } + if (cartridgeVersion_ != 0) { + output.writeUInt32(3, cartridgeVersion_); + } + if (cartridgeData_ != 0) { + output.writeUInt32(4, cartridgeData_); + } + if (cartridgeUsed_ != false) { + output.writeBool(5, cartridgeUsed_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (cartridgeId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, cartridgeId_); + } + if (cartridgeColor_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, cartridgeColor_); + } + if (cartridgeVersion_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, cartridgeVersion_); + } + if (cartridgeData_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, cartridgeData_); + } + if (cartridgeUsed_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(5, cartridgeUsed_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest other = (com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest) obj; + + boolean result = true; + result = result && (getCartridgeId() + == other.getCartridgeId()); + result = result && (getCartridgeColor() + == other.getCartridgeColor()); + result = result && (getCartridgeVersion() + == other.getCartridgeVersion()); + result = result && (getCartridgeData() + == other.getCartridgeData()); + result = result && (getCartridgeUsed() + == other.getCartridgeUsed()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CARTRIDGEID_FIELD_NUMBER; + hash = (53 * hash) + getCartridgeId(); + hash = (37 * hash) + CARTRIDGECOLOR_FIELD_NUMBER; + hash = (53 * hash) + getCartridgeColor(); + hash = (37 * hash) + CARTRIDGEVERSION_FIELD_NUMBER; + hash = (53 * hash) + getCartridgeVersion(); + hash = (37 * hash) + CARTRIDGEDATA_FIELD_NUMBER; + hash = (53 * hash) + getCartridgeData(); + hash = (37 * hash) + CARTRIDGEUSED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getCartridgeUsed()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubCartridgeWriteRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubCartridgeWriteRequest) + com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.internal_static_Tango_PMR_Stubs_StubCartridgeWriteRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.internal_static_Tango_PMR_Stubs_StubCartridgeWriteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest.class, com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + cartridgeId_ = 0; + + cartridgeColor_ = 0; + + cartridgeVersion_ = 0; + + cartridgeData_ = 0; + + cartridgeUsed_ = false; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.internal_static_Tango_PMR_Stubs_StubCartridgeWriteRequest_descriptor; + } + + public com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest build() { + com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest buildPartial() { + com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest result = new com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest(this); + result.cartridgeId_ = cartridgeId_; + result.cartridgeColor_ = cartridgeColor_; + result.cartridgeVersion_ = cartridgeVersion_; + result.cartridgeData_ = cartridgeData_; + result.cartridgeUsed_ = cartridgeUsed_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest) { + return mergeFrom((com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest other) { + if (other == com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest.getDefaultInstance()) return this; + if (other.getCartridgeId() != 0) { + setCartridgeId(other.getCartridgeId()); + } + if (other.getCartridgeColor() != 0) { + setCartridgeColor(other.getCartridgeColor()); + } + if (other.getCartridgeVersion() != 0) { + setCartridgeVersion(other.getCartridgeVersion()); + } + if (other.getCartridgeData() != 0) { + setCartridgeData(other.getCartridgeData()); + } + if (other.getCartridgeUsed() != false) { + setCartridgeUsed(other.getCartridgeUsed()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int cartridgeId_ ; + /** + * <pre> + *0..7 + * </pre> + * + * <code>uint32 CartridgeId = 1;</code> + */ + public int getCartridgeId() { + return cartridgeId_; + } + /** + * <pre> + *0..7 + * </pre> + * + * <code>uint32 CartridgeId = 1;</code> + */ + public Builder setCartridgeId(int value) { + + cartridgeId_ = value; + onChanged(); + return this; + } + /** + * <pre> + *0..7 + * </pre> + * + * <code>uint32 CartridgeId = 1;</code> + */ + public Builder clearCartridgeId() { + + cartridgeId_ = 0; + onChanged(); + return this; + } + + private int cartridgeColor_ ; + /** + * <pre> + * </pre> + * + * <code>uint32 CartridgeColor = 2;</code> + */ + public int getCartridgeColor() { + return cartridgeColor_; + } + /** + * <pre> + * </pre> + * + * <code>uint32 CartridgeColor = 2;</code> + */ + public Builder setCartridgeColor(int value) { + + cartridgeColor_ = value; + onChanged(); + return this; + } + /** + * <pre> + * </pre> + * + * <code>uint32 CartridgeColor = 2;</code> + */ + public Builder clearCartridgeColor() { + + cartridgeColor_ = 0; + onChanged(); + return this; + } + + private int cartridgeVersion_ ; + /** + * <code>uint32 CartridgeVersion = 3;</code> + */ + public int getCartridgeVersion() { + return cartridgeVersion_; + } + /** + * <code>uint32 CartridgeVersion = 3;</code> + */ + public Builder setCartridgeVersion(int value) { + + cartridgeVersion_ = value; + onChanged(); + return this; + } + /** + * <code>uint32 CartridgeVersion = 3;</code> + */ + public Builder clearCartridgeVersion() { + + cartridgeVersion_ = 0; + onChanged(); + return this; + } + + private int cartridgeData_ ; + /** + * <code>uint32 CartridgeData = 4;</code> + */ + public int getCartridgeData() { + return cartridgeData_; + } + /** + * <code>uint32 CartridgeData = 4;</code> + */ + public Builder setCartridgeData(int value) { + + cartridgeData_ = value; + onChanged(); + return this; + } + /** + * <code>uint32 CartridgeData = 4;</code> + */ + public Builder clearCartridgeData() { + + cartridgeData_ = 0; + onChanged(); + return this; + } + + private boolean cartridgeUsed_ ; + /** + * <pre> + * 0 - new 1- used + * </pre> + * + * <code>bool CartridgeUsed = 5;</code> + */ + public boolean getCartridgeUsed() { + return cartridgeUsed_; + } + /** + * <pre> + * 0 - new 1- used + * </pre> + * + * <code>bool CartridgeUsed = 5;</code> + */ + public Builder setCartridgeUsed(boolean value) { + + cartridgeUsed_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0 - new 1- used + * </pre> + * + * <code>bool CartridgeUsed = 5;</code> + */ + public Builder clearCartridgeUsed() { + + cartridgeUsed_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubCartridgeWriteRequest) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubCartridgeWriteRequest) + private static final com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest(); + } + + public static com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubCartridgeWriteRequest> + PARSER = new com.google.protobuf.AbstractParser<StubCartridgeWriteRequest>() { + public StubCartridgeWriteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubCartridgeWriteRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubCartridgeWriteRequest> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubCartridgeWriteRequest> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubCartridgeWriteRequestOuterClass.StubCartridgeWriteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubCartridgeWriteRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubCartridgeWriteRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\037StubCartridgeWriteRequest.proto\022\017Tango" + + ".PMR.Stubs\"\220\001\n\031StubCartridgeWriteRequest" + + "\022\023\n\013CartridgeId\030\001 \001(\r\022\026\n\016CartridgeColor\030" + + "\002 \001(\r\022\030\n\020CartridgeVersion\030\003 \001(\r\022\025\n\rCartr" + + "idgeData\030\004 \001(\r\022\025\n\rCartridgeUsed\030\005 \001(\010B\033\n" + + "\031com.twine.tango.pmr.stubsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubCartridgeWriteRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubCartridgeWriteRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubCartridgeWriteRequest_descriptor, + new java.lang.String[] { "CartridgeId", "CartridgeColor", "CartridgeVersion", "CartridgeData", "CartridgeUsed", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubCartridgeWriteResponseOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubCartridgeWriteResponseOuterClass.java new file mode 100644 index 000000000..12795b75c --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubCartridgeWriteResponseOuterClass.java @@ -0,0 +1,568 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubCartridgeWriteResponse.proto + +package com.twine.tango.pmr.stubs; + +public final class StubCartridgeWriteResponseOuterClass { + private StubCartridgeWriteResponseOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubCartridgeWriteResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubCartridgeWriteResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>uint32 CartridgeId = 1;</code> + */ + int getCartridgeId(); + + /** + * <code>uint32 Status = 8;</code> + */ + int getStatus(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubCartridgeWriteResponse} + */ + public static final class StubCartridgeWriteResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubCartridgeWriteResponse) + StubCartridgeWriteResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubCartridgeWriteResponse.newBuilder() to construct. + private StubCartridgeWriteResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubCartridgeWriteResponse() { + cartridgeId_ = 0; + status_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubCartridgeWriteResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + cartridgeId_ = input.readUInt32(); + break; + } + case 64: { + + status_ = input.readUInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.internal_static_Tango_PMR_Stubs_StubCartridgeWriteResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.internal_static_Tango_PMR_Stubs_StubCartridgeWriteResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse.class, com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse.Builder.class); + } + + public static final int CARTRIDGEID_FIELD_NUMBER = 1; + private int cartridgeId_; + /** + * <code>uint32 CartridgeId = 1;</code> + */ + public int getCartridgeId() { + return cartridgeId_; + } + + public static final int STATUS_FIELD_NUMBER = 8; + private int status_; + /** + * <code>uint32 Status = 8;</code> + */ + public int getStatus() { + return status_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (cartridgeId_ != 0) { + output.writeUInt32(1, cartridgeId_); + } + if (status_ != 0) { + output.writeUInt32(8, status_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (cartridgeId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, cartridgeId_); + } + if (status_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(8, status_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse other = (com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse) obj; + + boolean result = true; + result = result && (getCartridgeId() + == other.getCartridgeId()); + result = result && (getStatus() + == other.getStatus()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CARTRIDGEID_FIELD_NUMBER; + hash = (53 * hash) + getCartridgeId(); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubCartridgeWriteResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubCartridgeWriteResponse) + com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.internal_static_Tango_PMR_Stubs_StubCartridgeWriteResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.internal_static_Tango_PMR_Stubs_StubCartridgeWriteResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse.class, com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + cartridgeId_ = 0; + + status_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.internal_static_Tango_PMR_Stubs_StubCartridgeWriteResponse_descriptor; + } + + public com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse build() { + com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse buildPartial() { + com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse result = new com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse(this); + result.cartridgeId_ = cartridgeId_; + result.status_ = status_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse) { + return mergeFrom((com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse other) { + if (other == com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse.getDefaultInstance()) return this; + if (other.getCartridgeId() != 0) { + setCartridgeId(other.getCartridgeId()); + } + if (other.getStatus() != 0) { + setStatus(other.getStatus()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int cartridgeId_ ; + /** + * <code>uint32 CartridgeId = 1;</code> + */ + public int getCartridgeId() { + return cartridgeId_; + } + /** + * <code>uint32 CartridgeId = 1;</code> + */ + public Builder setCartridgeId(int value) { + + cartridgeId_ = value; + onChanged(); + return this; + } + /** + * <code>uint32 CartridgeId = 1;</code> + */ + public Builder clearCartridgeId() { + + cartridgeId_ = 0; + onChanged(); + return this; + } + + private int status_ ; + /** + * <code>uint32 Status = 8;</code> + */ + public int getStatus() { + return status_; + } + /** + * <code>uint32 Status = 8;</code> + */ + public Builder setStatus(int value) { + + status_ = value; + onChanged(); + return this; + } + /** + * <code>uint32 Status = 8;</code> + */ + public Builder clearStatus() { + + status_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubCartridgeWriteResponse) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubCartridgeWriteResponse) + private static final com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse(); + } + + public static com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubCartridgeWriteResponse> + PARSER = new com.google.protobuf.AbstractParser<StubCartridgeWriteResponse>() { + public StubCartridgeWriteResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubCartridgeWriteResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubCartridgeWriteResponse> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubCartridgeWriteResponse> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubCartridgeWriteResponseOuterClass.StubCartridgeWriteResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubCartridgeWriteResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubCartridgeWriteResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n StubCartridgeWriteResponse.proto\022\017Tang" + + "o.PMR.Stubs\"A\n\032StubCartridgeWriteRespons" + + "e\022\023\n\013CartridgeId\030\001 \001(\r\022\016\n\006Status\030\010 \001(\rB\033" + + "\n\031com.twine.tango.pmr.stubsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubCartridgeWriteResponse_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubCartridgeWriteResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubCartridgeWriteResponse_descriptor, + new java.lang.String[] { "CartridgeId", "Status", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubDispenserRequestOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubDispenserRequestOuterClass.java new file mode 100644 index 000000000..e169dfd16 --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubDispenserRequestOuterClass.java @@ -0,0 +1,841 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubDispenserRequest.proto + +package com.twine.tango.pmr.stubs; + +public final class StubDispenserRequestOuterClass { + private StubDispenserRequestOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubDispenserRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubDispenserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 DispenserId = 1;</code> + */ + int getDispenserId(); + + /** + * <pre> + * 1-start 0-stop + * </pre> + * + * <code>bool Start = 2;</code> + */ + boolean getStart(); + + /** + * <pre> + * 1-cw 0-ccw + * </pre> + * + * <code>bool SetDirection = 3;</code> + */ + boolean getSetDirection(); + + /** + * <pre> + * No. of steps for 360 deg. + * </pre> + * + * <code>int32 SetMicrostepDivision = 4;</code> + */ + int getSetMicrostepDivision(); + + /** + * <code>int32 SetSpeed = 5;</code> + */ + int getSetSpeed(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubDispenserRequest} + */ + public static final class StubDispenserRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubDispenserRequest) + StubDispenserRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubDispenserRequest.newBuilder() to construct. + private StubDispenserRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubDispenserRequest() { + dispenserId_ = 0; + start_ = false; + setDirection_ = false; + setMicrostepDivision_ = 0; + setSpeed_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubDispenserRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + dispenserId_ = input.readUInt32(); + break; + } + case 16: { + + start_ = input.readBool(); + break; + } + case 24: { + + setDirection_ = input.readBool(); + break; + } + case 32: { + + setMicrostepDivision_ = input.readInt32(); + break; + } + case 40: { + + setSpeed_ = input.readInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.internal_static_Tango_PMR_Stubs_StubDispenserRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.internal_static_Tango_PMR_Stubs_StubDispenserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest.class, com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest.Builder.class); + } + + public static final int DISPENSERID_FIELD_NUMBER = 1; + private int dispenserId_; + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 DispenserId = 1;</code> + */ + public int getDispenserId() { + return dispenserId_; + } + + public static final int START_FIELD_NUMBER = 2; + private boolean start_; + /** + * <pre> + * 1-start 0-stop + * </pre> + * + * <code>bool Start = 2;</code> + */ + public boolean getStart() { + return start_; + } + + public static final int SETDIRECTION_FIELD_NUMBER = 3; + private boolean setDirection_; + /** + * <pre> + * 1-cw 0-ccw + * </pre> + * + * <code>bool SetDirection = 3;</code> + */ + public boolean getSetDirection() { + return setDirection_; + } + + public static final int SETMICROSTEPDIVISION_FIELD_NUMBER = 4; + private int setMicrostepDivision_; + /** + * <pre> + * No. of steps for 360 deg. + * </pre> + * + * <code>int32 SetMicrostepDivision = 4;</code> + */ + public int getSetMicrostepDivision() { + return setMicrostepDivision_; + } + + public static final int SETSPEED_FIELD_NUMBER = 5; + private int setSpeed_; + /** + * <code>int32 SetSpeed = 5;</code> + */ + public int getSetSpeed() { + return setSpeed_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (dispenserId_ != 0) { + output.writeUInt32(1, dispenserId_); + } + if (start_ != false) { + output.writeBool(2, start_); + } + if (setDirection_ != false) { + output.writeBool(3, setDirection_); + } + if (setMicrostepDivision_ != 0) { + output.writeInt32(4, setMicrostepDivision_); + } + if (setSpeed_ != 0) { + output.writeInt32(5, setSpeed_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dispenserId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, dispenserId_); + } + if (start_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, start_); + } + if (setDirection_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, setDirection_); + } + if (setMicrostepDivision_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, setMicrostepDivision_); + } + if (setSpeed_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, setSpeed_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest other = (com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest) obj; + + boolean result = true; + result = result && (getDispenserId() + == other.getDispenserId()); + result = result && (getStart() + == other.getStart()); + result = result && (getSetDirection() + == other.getSetDirection()); + result = result && (getSetMicrostepDivision() + == other.getSetMicrostepDivision()); + result = result && (getSetSpeed() + == other.getSetSpeed()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DISPENSERID_FIELD_NUMBER; + hash = (53 * hash) + getDispenserId(); + hash = (37 * hash) + START_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getStart()); + hash = (37 * hash) + SETDIRECTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getSetDirection()); + hash = (37 * hash) + SETMICROSTEPDIVISION_FIELD_NUMBER; + hash = (53 * hash) + getSetMicrostepDivision(); + hash = (37 * hash) + SETSPEED_FIELD_NUMBER; + hash = (53 * hash) + getSetSpeed(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubDispenserRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubDispenserRequest) + com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.internal_static_Tango_PMR_Stubs_StubDispenserRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.internal_static_Tango_PMR_Stubs_StubDispenserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest.class, com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + dispenserId_ = 0; + + start_ = false; + + setDirection_ = false; + + setMicrostepDivision_ = 0; + + setSpeed_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.internal_static_Tango_PMR_Stubs_StubDispenserRequest_descriptor; + } + + public com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest build() { + com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest buildPartial() { + com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest result = new com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest(this); + result.dispenserId_ = dispenserId_; + result.start_ = start_; + result.setDirection_ = setDirection_; + result.setMicrostepDivision_ = setMicrostepDivision_; + result.setSpeed_ = setSpeed_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest) { + return mergeFrom((com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest other) { + if (other == com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest.getDefaultInstance()) return this; + if (other.getDispenserId() != 0) { + setDispenserId(other.getDispenserId()); + } + if (other.getStart() != false) { + setStart(other.getStart()); + } + if (other.getSetDirection() != false) { + setSetDirection(other.getSetDirection()); + } + if (other.getSetMicrostepDivision() != 0) { + setSetMicrostepDivision(other.getSetMicrostepDivision()); + } + if (other.getSetSpeed() != 0) { + setSetSpeed(other.getSetSpeed()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int dispenserId_ ; + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 DispenserId = 1;</code> + */ + public int getDispenserId() { + return dispenserId_; + } + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 DispenserId = 1;</code> + */ + public Builder setDispenserId(int value) { + + dispenserId_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 DispenserId = 1;</code> + */ + public Builder clearDispenserId() { + + dispenserId_ = 0; + onChanged(); + return this; + } + + private boolean start_ ; + /** + * <pre> + * 1-start 0-stop + * </pre> + * + * <code>bool Start = 2;</code> + */ + public boolean getStart() { + return start_; + } + /** + * <pre> + * 1-start 0-stop + * </pre> + * + * <code>bool Start = 2;</code> + */ + public Builder setStart(boolean value) { + + start_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 1-start 0-stop + * </pre> + * + * <code>bool Start = 2;</code> + */ + public Builder clearStart() { + + start_ = false; + onChanged(); + return this; + } + + private boolean setDirection_ ; + /** + * <pre> + * 1-cw 0-ccw + * </pre> + * + * <code>bool SetDirection = 3;</code> + */ + public boolean getSetDirection() { + return setDirection_; + } + /** + * <pre> + * 1-cw 0-ccw + * </pre> + * + * <code>bool SetDirection = 3;</code> + */ + public Builder setSetDirection(boolean value) { + + setDirection_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 1-cw 0-ccw + * </pre> + * + * <code>bool SetDirection = 3;</code> + */ + public Builder clearSetDirection() { + + setDirection_ = false; + onChanged(); + return this; + } + + private int setMicrostepDivision_ ; + /** + * <pre> + * No. of steps for 360 deg. + * </pre> + * + * <code>int32 SetMicrostepDivision = 4;</code> + */ + public int getSetMicrostepDivision() { + return setMicrostepDivision_; + } + /** + * <pre> + * No. of steps for 360 deg. + * </pre> + * + * <code>int32 SetMicrostepDivision = 4;</code> + */ + public Builder setSetMicrostepDivision(int value) { + + setMicrostepDivision_ = value; + onChanged(); + return this; + } + /** + * <pre> + * No. of steps for 360 deg. + * </pre> + * + * <code>int32 SetMicrostepDivision = 4;</code> + */ + public Builder clearSetMicrostepDivision() { + + setMicrostepDivision_ = 0; + onChanged(); + return this; + } + + private int setSpeed_ ; + /** + * <code>int32 SetSpeed = 5;</code> + */ + public int getSetSpeed() { + return setSpeed_; + } + /** + * <code>int32 SetSpeed = 5;</code> + */ + public Builder setSetSpeed(int value) { + + setSpeed_ = value; + onChanged(); + return this; + } + /** + * <code>int32 SetSpeed = 5;</code> + */ + public Builder clearSetSpeed() { + + setSpeed_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubDispenserRequest) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubDispenserRequest) + private static final com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest(); + } + + public static com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubDispenserRequest> + PARSER = new com.google.protobuf.AbstractParser<StubDispenserRequest>() { + public StubDispenserRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubDispenserRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubDispenserRequest> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubDispenserRequest> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubDispenserRequestOuterClass.StubDispenserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubDispenserRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubDispenserRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\032StubDispenserRequest.proto\022\017Tango.PMR." + + "Stubs\"\200\001\n\024StubDispenserRequest\022\023\n\013Dispen" + + "serId\030\001 \001(\r\022\r\n\005Start\030\002 \001(\010\022\024\n\014SetDirecti" + + "on\030\003 \001(\010\022\034\n\024SetMicrostepDivision\030\004 \001(\005\022\020" + + "\n\010SetSpeed\030\005 \001(\005B\033\n\031com.twine.tango.pmr." + + "stubsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubDispenserRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubDispenserRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubDispenserRequest_descriptor, + new java.lang.String[] { "DispenserId", "Start", "SetDirection", "SetMicrostepDivision", "SetSpeed", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubDispenserResponseOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubDispenserResponseOuterClass.java new file mode 100644 index 000000000..8f6354be7 --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubDispenserResponseOuterClass.java @@ -0,0 +1,771 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubDispenserResponse.proto + +package com.twine.tango.pmr.stubs; + +public final class StubDispenserResponseOuterClass { + private StubDispenserResponseOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubDispenserResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubDispenserResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 DispenserId = 1;</code> + */ + int getDispenserId(); + + /** + * <pre> + * </pre> + * + * <code>uint32 DispenserPosition = 2;</code> + */ + int getDispenserPosition(); + + /** + * <pre> + * 1- critical 2- level 3- overflow + * </pre> + * + * <code>uint32 InkWorningLevel = 3;</code> + */ + int getInkWorningLevel(); + + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 4;</code> + */ + boolean getStatus(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubDispenserResponse} + */ + public static final class StubDispenserResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubDispenserResponse) + StubDispenserResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubDispenserResponse.newBuilder() to construct. + private StubDispenserResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubDispenserResponse() { + dispenserId_ = 0; + dispenserPosition_ = 0; + inkWorningLevel_ = 0; + status_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubDispenserResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + dispenserId_ = input.readUInt32(); + break; + } + case 16: { + + dispenserPosition_ = input.readUInt32(); + break; + } + case 24: { + + inkWorningLevel_ = input.readUInt32(); + break; + } + case 32: { + + status_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.internal_static_Tango_PMR_Stubs_StubDispenserResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.internal_static_Tango_PMR_Stubs_StubDispenserResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse.class, com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse.Builder.class); + } + + public static final int DISPENSERID_FIELD_NUMBER = 1; + private int dispenserId_; + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 DispenserId = 1;</code> + */ + public int getDispenserId() { + return dispenserId_; + } + + public static final int DISPENSERPOSITION_FIELD_NUMBER = 2; + private int dispenserPosition_; + /** + * <pre> + * </pre> + * + * <code>uint32 DispenserPosition = 2;</code> + */ + public int getDispenserPosition() { + return dispenserPosition_; + } + + public static final int INKWORNINGLEVEL_FIELD_NUMBER = 3; + private int inkWorningLevel_; + /** + * <pre> + * 1- critical 2- level 3- overflow + * </pre> + * + * <code>uint32 InkWorningLevel = 3;</code> + */ + public int getInkWorningLevel() { + return inkWorningLevel_; + } + + public static final int STATUS_FIELD_NUMBER = 4; + private boolean status_; + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 4;</code> + */ + public boolean getStatus() { + return status_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (dispenserId_ != 0) { + output.writeUInt32(1, dispenserId_); + } + if (dispenserPosition_ != 0) { + output.writeUInt32(2, dispenserPosition_); + } + if (inkWorningLevel_ != 0) { + output.writeUInt32(3, inkWorningLevel_); + } + if (status_ != false) { + output.writeBool(4, status_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dispenserId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, dispenserId_); + } + if (dispenserPosition_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, dispenserPosition_); + } + if (inkWorningLevel_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, inkWorningLevel_); + } + if (status_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(4, status_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse other = (com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse) obj; + + boolean result = true; + result = result && (getDispenserId() + == other.getDispenserId()); + result = result && (getDispenserPosition() + == other.getDispenserPosition()); + result = result && (getInkWorningLevel() + == other.getInkWorningLevel()); + result = result && (getStatus() + == other.getStatus()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DISPENSERID_FIELD_NUMBER; + hash = (53 * hash) + getDispenserId(); + hash = (37 * hash) + DISPENSERPOSITION_FIELD_NUMBER; + hash = (53 * hash) + getDispenserPosition(); + hash = (37 * hash) + INKWORNINGLEVEL_FIELD_NUMBER; + hash = (53 * hash) + getInkWorningLevel(); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getStatus()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubDispenserResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubDispenserResponse) + com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.internal_static_Tango_PMR_Stubs_StubDispenserResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.internal_static_Tango_PMR_Stubs_StubDispenserResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse.class, com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + dispenserId_ = 0; + + dispenserPosition_ = 0; + + inkWorningLevel_ = 0; + + status_ = false; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.internal_static_Tango_PMR_Stubs_StubDispenserResponse_descriptor; + } + + public com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse build() { + com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse buildPartial() { + com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse result = new com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse(this); + result.dispenserId_ = dispenserId_; + result.dispenserPosition_ = dispenserPosition_; + result.inkWorningLevel_ = inkWorningLevel_; + result.status_ = status_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse) { + return mergeFrom((com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse other) { + if (other == com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse.getDefaultInstance()) return this; + if (other.getDispenserId() != 0) { + setDispenserId(other.getDispenserId()); + } + if (other.getDispenserPosition() != 0) { + setDispenserPosition(other.getDispenserPosition()); + } + if (other.getInkWorningLevel() != 0) { + setInkWorningLevel(other.getInkWorningLevel()); + } + if (other.getStatus() != false) { + setStatus(other.getStatus()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int dispenserId_ ; + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 DispenserId = 1;</code> + */ + public int getDispenserId() { + return dispenserId_; + } + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 DispenserId = 1;</code> + */ + public Builder setDispenserId(int value) { + + dispenserId_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 DispenserId = 1;</code> + */ + public Builder clearDispenserId() { + + dispenserId_ = 0; + onChanged(); + return this; + } + + private int dispenserPosition_ ; + /** + * <pre> + * </pre> + * + * <code>uint32 DispenserPosition = 2;</code> + */ + public int getDispenserPosition() { + return dispenserPosition_; + } + /** + * <pre> + * </pre> + * + * <code>uint32 DispenserPosition = 2;</code> + */ + public Builder setDispenserPosition(int value) { + + dispenserPosition_ = value; + onChanged(); + return this; + } + /** + * <pre> + * </pre> + * + * <code>uint32 DispenserPosition = 2;</code> + */ + public Builder clearDispenserPosition() { + + dispenserPosition_ = 0; + onChanged(); + return this; + } + + private int inkWorningLevel_ ; + /** + * <pre> + * 1- critical 2- level 3- overflow + * </pre> + * + * <code>uint32 InkWorningLevel = 3;</code> + */ + public int getInkWorningLevel() { + return inkWorningLevel_; + } + /** + * <pre> + * 1- critical 2- level 3- overflow + * </pre> + * + * <code>uint32 InkWorningLevel = 3;</code> + */ + public Builder setInkWorningLevel(int value) { + + inkWorningLevel_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 1- critical 2- level 3- overflow + * </pre> + * + * <code>uint32 InkWorningLevel = 3;</code> + */ + public Builder clearInkWorningLevel() { + + inkWorningLevel_ = 0; + onChanged(); + return this; + } + + private boolean status_ ; + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 4;</code> + */ + public boolean getStatus() { + return status_; + } + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 4;</code> + */ + public Builder setStatus(boolean value) { + + status_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 4;</code> + */ + public Builder clearStatus() { + + status_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubDispenserResponse) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubDispenserResponse) + private static final com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse(); + } + + public static com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubDispenserResponse> + PARSER = new com.google.protobuf.AbstractParser<StubDispenserResponse>() { + public StubDispenserResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubDispenserResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubDispenserResponse> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubDispenserResponse> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubDispenserResponseOuterClass.StubDispenserResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubDispenserResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubDispenserResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\033StubDispenserResponse.proto\022\017Tango.PMR" + + ".Stubs\"p\n\025StubDispenserResponse\022\023\n\013Dispe" + + "nserId\030\001 \001(\r\022\031\n\021DispenserPosition\030\002 \001(\r\022" + + "\027\n\017InkWorningLevel\030\003 \001(\r\022\016\n\006Status\030\004 \001(\010" + + "B\033\n\031com.twine.tango.pmr.stubsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubDispenserResponse_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubDispenserResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubDispenserResponse_descriptor, + new java.lang.String[] { "DispenserId", "DispenserPosition", "InkWorningLevel", "Status", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadBitRequestOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadBitRequestOuterClass.java new file mode 100644 index 000000000..504cfbacb --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadBitRequestOuterClass.java @@ -0,0 +1,608 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubGPIOReadBitRequest.proto + +package com.twine.tango.pmr.stubs; + +public final class StubGPIOReadBitRequestOuterClass { + private StubGPIOReadBitRequestOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubGPIOReadBitRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubGPIOReadBitRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + int getPortId(); + + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 PinId = 2;</code> + */ + int getPinId(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubGPIOReadBitRequest} + */ + public static final class StubGPIOReadBitRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubGPIOReadBitRequest) + StubGPIOReadBitRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubGPIOReadBitRequest.newBuilder() to construct. + private StubGPIOReadBitRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubGPIOReadBitRequest() { + portId_ = 0; + pinId_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubGPIOReadBitRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + portId_ = input.readUInt32(); + break; + } + case 16: { + + pinId_ = input.readUInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOReadBitRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOReadBitRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest.class, com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest.Builder.class); + } + + public static final int PORTID_FIELD_NUMBER = 1; + private int portId_; + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public int getPortId() { + return portId_; + } + + public static final int PINID_FIELD_NUMBER = 2; + private int pinId_; + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 PinId = 2;</code> + */ + public int getPinId() { + return pinId_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (portId_ != 0) { + output.writeUInt32(1, portId_); + } + if (pinId_ != 0) { + output.writeUInt32(2, pinId_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (portId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, portId_); + } + if (pinId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, pinId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest other = (com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest) obj; + + boolean result = true; + result = result && (getPortId() + == other.getPortId()); + result = result && (getPinId() + == other.getPinId()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PORTID_FIELD_NUMBER; + hash = (53 * hash) + getPortId(); + hash = (37 * hash) + PINID_FIELD_NUMBER; + hash = (53 * hash) + getPinId(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubGPIOReadBitRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubGPIOReadBitRequest) + com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOReadBitRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOReadBitRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest.class, com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + portId_ = 0; + + pinId_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOReadBitRequest_descriptor; + } + + public com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest build() { + com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest buildPartial() { + com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest result = new com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest(this); + result.portId_ = portId_; + result.pinId_ = pinId_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest) { + return mergeFrom((com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest other) { + if (other == com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest.getDefaultInstance()) return this; + if (other.getPortId() != 0) { + setPortId(other.getPortId()); + } + if (other.getPinId() != 0) { + setPinId(other.getPinId()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int portId_ ; + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public int getPortId() { + return portId_; + } + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public Builder setPortId(int value) { + + portId_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public Builder clearPortId() { + + portId_ = 0; + onChanged(); + return this; + } + + private int pinId_ ; + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 PinId = 2;</code> + */ + public int getPinId() { + return pinId_; + } + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 PinId = 2;</code> + */ + public Builder setPinId(int value) { + + pinId_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 PinId = 2;</code> + */ + public Builder clearPinId() { + + pinId_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubGPIOReadBitRequest) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubGPIOReadBitRequest) + private static final com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest(); + } + + public static com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubGPIOReadBitRequest> + PARSER = new com.google.protobuf.AbstractParser<StubGPIOReadBitRequest>() { + public StubGPIOReadBitRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubGPIOReadBitRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubGPIOReadBitRequest> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubGPIOReadBitRequest> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubGPIOReadBitRequestOuterClass.StubGPIOReadBitRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubGPIOReadBitRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubGPIOReadBitRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\034StubGPIOReadBitRequest.proto\022\017Tango.PM" + + "R.Stubs\"7\n\026StubGPIOReadBitRequest\022\016\n\006Por" + + "tId\030\001 \001(\r\022\r\n\005PinId\030\002 \001(\rB\033\n\031com.twine.ta" + + "ngo.pmr.stubsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubGPIOReadBitRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubGPIOReadBitRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubGPIOReadBitRequest_descriptor, + new java.lang.String[] { "PortId", "PinId", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadBitResponseOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadBitResponseOuterClass.java new file mode 100644 index 000000000..a1749ecc8 --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadBitResponseOuterClass.java @@ -0,0 +1,757 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubGPIOReadBitResponse.proto + +package com.twine.tango.pmr.stubs; + +public final class StubGPIOReadBitResponseOuterClass { + private StubGPIOReadBitResponseOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubGPIOReadBitResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubGPIOReadBitResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + int getPortId(); + + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 PinId = 2;</code> + */ + int getPinId(); + + /** + * <code>bool BitValue = 3;</code> + */ + boolean getBitValue(); + + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 4;</code> + */ + boolean getStatus(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubGPIOReadBitResponse} + */ + public static final class StubGPIOReadBitResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubGPIOReadBitResponse) + StubGPIOReadBitResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubGPIOReadBitResponse.newBuilder() to construct. + private StubGPIOReadBitResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubGPIOReadBitResponse() { + portId_ = 0; + pinId_ = 0; + bitValue_ = false; + status_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubGPIOReadBitResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + portId_ = input.readUInt32(); + break; + } + case 16: { + + pinId_ = input.readUInt32(); + break; + } + case 24: { + + bitValue_ = input.readBool(); + break; + } + case 32: { + + status_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOReadBitResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOReadBitResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse.class, com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse.Builder.class); + } + + public static final int PORTID_FIELD_NUMBER = 1; + private int portId_; + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public int getPortId() { + return portId_; + } + + public static final int PINID_FIELD_NUMBER = 2; + private int pinId_; + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 PinId = 2;</code> + */ + public int getPinId() { + return pinId_; + } + + public static final int BITVALUE_FIELD_NUMBER = 3; + private boolean bitValue_; + /** + * <code>bool BitValue = 3;</code> + */ + public boolean getBitValue() { + return bitValue_; + } + + public static final int STATUS_FIELD_NUMBER = 4; + private boolean status_; + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 4;</code> + */ + public boolean getStatus() { + return status_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (portId_ != 0) { + output.writeUInt32(1, portId_); + } + if (pinId_ != 0) { + output.writeUInt32(2, pinId_); + } + if (bitValue_ != false) { + output.writeBool(3, bitValue_); + } + if (status_ != false) { + output.writeBool(4, status_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (portId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, portId_); + } + if (pinId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, pinId_); + } + if (bitValue_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, bitValue_); + } + if (status_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(4, status_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse other = (com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse) obj; + + boolean result = true; + result = result && (getPortId() + == other.getPortId()); + result = result && (getPinId() + == other.getPinId()); + result = result && (getBitValue() + == other.getBitValue()); + result = result && (getStatus() + == other.getStatus()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PORTID_FIELD_NUMBER; + hash = (53 * hash) + getPortId(); + hash = (37 * hash) + PINID_FIELD_NUMBER; + hash = (53 * hash) + getPinId(); + hash = (37 * hash) + BITVALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getBitValue()); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getStatus()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubGPIOReadBitResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubGPIOReadBitResponse) + com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOReadBitResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOReadBitResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse.class, com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + portId_ = 0; + + pinId_ = 0; + + bitValue_ = false; + + status_ = false; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOReadBitResponse_descriptor; + } + + public com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse build() { + com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse buildPartial() { + com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse result = new com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse(this); + result.portId_ = portId_; + result.pinId_ = pinId_; + result.bitValue_ = bitValue_; + result.status_ = status_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse) { + return mergeFrom((com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse other) { + if (other == com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse.getDefaultInstance()) return this; + if (other.getPortId() != 0) { + setPortId(other.getPortId()); + } + if (other.getPinId() != 0) { + setPinId(other.getPinId()); + } + if (other.getBitValue() != false) { + setBitValue(other.getBitValue()); + } + if (other.getStatus() != false) { + setStatus(other.getStatus()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int portId_ ; + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public int getPortId() { + return portId_; + } + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public Builder setPortId(int value) { + + portId_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public Builder clearPortId() { + + portId_ = 0; + onChanged(); + return this; + } + + private int pinId_ ; + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 PinId = 2;</code> + */ + public int getPinId() { + return pinId_; + } + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 PinId = 2;</code> + */ + public Builder setPinId(int value) { + + pinId_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 PinId = 2;</code> + */ + public Builder clearPinId() { + + pinId_ = 0; + onChanged(); + return this; + } + + private boolean bitValue_ ; + /** + * <code>bool BitValue = 3;</code> + */ + public boolean getBitValue() { + return bitValue_; + } + /** + * <code>bool BitValue = 3;</code> + */ + public Builder setBitValue(boolean value) { + + bitValue_ = value; + onChanged(); + return this; + } + /** + * <code>bool BitValue = 3;</code> + */ + public Builder clearBitValue() { + + bitValue_ = false; + onChanged(); + return this; + } + + private boolean status_ ; + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 4;</code> + */ + public boolean getStatus() { + return status_; + } + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 4;</code> + */ + public Builder setStatus(boolean value) { + + status_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 4;</code> + */ + public Builder clearStatus() { + + status_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubGPIOReadBitResponse) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubGPIOReadBitResponse) + private static final com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse(); + } + + public static com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubGPIOReadBitResponse> + PARSER = new com.google.protobuf.AbstractParser<StubGPIOReadBitResponse>() { + public StubGPIOReadBitResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubGPIOReadBitResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubGPIOReadBitResponse> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubGPIOReadBitResponse> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubGPIOReadBitResponseOuterClass.StubGPIOReadBitResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubGPIOReadBitResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubGPIOReadBitResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\035StubGPIOReadBitResponse.proto\022\017Tango.P" + + "MR.Stubs\"Z\n\027StubGPIOReadBitResponse\022\016\n\006P" + + "ortId\030\001 \001(\r\022\r\n\005PinId\030\002 \001(\r\022\020\n\010BitValue\030\003" + + " \001(\010\022\016\n\006Status\030\004 \001(\010B\033\n\031com.twine.tango." + + "pmr.stubsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubGPIOReadBitResponse_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubGPIOReadBitResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubGPIOReadBitResponse_descriptor, + new java.lang.String[] { "PortId", "PinId", "BitValue", "Status", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadByteRequestOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadByteRequestOuterClass.java new file mode 100644 index 000000000..1ff44f3a9 --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadByteRequestOuterClass.java @@ -0,0 +1,525 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubGPIOReadByteRequest.proto + +package com.twine.tango.pmr.stubs; + +public final class StubGPIOReadByteRequestOuterClass { + private StubGPIOReadByteRequestOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubGPIOReadByteRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubGPIOReadByteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + int getPortId(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubGPIOReadByteRequest} + */ + public static final class StubGPIOReadByteRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubGPIOReadByteRequest) + StubGPIOReadByteRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubGPIOReadByteRequest.newBuilder() to construct. + private StubGPIOReadByteRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubGPIOReadByteRequest() { + portId_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubGPIOReadByteRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + portId_ = input.readUInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOReadByteRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOReadByteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest.class, com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest.Builder.class); + } + + public static final int PORTID_FIELD_NUMBER = 1; + private int portId_; + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public int getPortId() { + return portId_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (portId_ != 0) { + output.writeUInt32(1, portId_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (portId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, portId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest other = (com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest) obj; + + boolean result = true; + result = result && (getPortId() + == other.getPortId()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PORTID_FIELD_NUMBER; + hash = (53 * hash) + getPortId(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubGPIOReadByteRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubGPIOReadByteRequest) + com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOReadByteRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOReadByteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest.class, com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + portId_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOReadByteRequest_descriptor; + } + + public com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest build() { + com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest buildPartial() { + com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest result = new com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest(this); + result.portId_ = portId_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest) { + return mergeFrom((com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest other) { + if (other == com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest.getDefaultInstance()) return this; + if (other.getPortId() != 0) { + setPortId(other.getPortId()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int portId_ ; + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public int getPortId() { + return portId_; + } + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public Builder setPortId(int value) { + + portId_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public Builder clearPortId() { + + portId_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubGPIOReadByteRequest) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubGPIOReadByteRequest) + private static final com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest(); + } + + public static com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubGPIOReadByteRequest> + PARSER = new com.google.protobuf.AbstractParser<StubGPIOReadByteRequest>() { + public StubGPIOReadByteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubGPIOReadByteRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubGPIOReadByteRequest> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubGPIOReadByteRequest> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubGPIOReadByteRequestOuterClass.StubGPIOReadByteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubGPIOReadByteRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubGPIOReadByteRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\035StubGPIOReadByteRequest.proto\022\017Tango.P" + + "MR.Stubs\")\n\027StubGPIOReadByteRequest\022\016\n\006P" + + "ortId\030\001 \001(\rB\033\n\031com.twine.tango.pmr.stubs" + + "b\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubGPIOReadByteRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubGPIOReadByteRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubGPIOReadByteRequest_descriptor, + new java.lang.String[] { "PortId", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadByteResponseOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadByteResponseOuterClass.java new file mode 100644 index 000000000..757afbb4a --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOReadByteResponseOuterClass.java @@ -0,0 +1,673 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubGPIOReadByteResponse.proto + +package com.twine.tango.pmr.stubs; + +public final class StubGPIOReadByteResponseOuterClass { + private StubGPIOReadByteResponseOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubGPIOReadByteResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubGPIOReadByteResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + int getPortId(); + + /** + * <code>uint32 ByteValue = 2;</code> + */ + int getByteValue(); + + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool status = 3;</code> + */ + boolean getStatus(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubGPIOReadByteResponse} + */ + public static final class StubGPIOReadByteResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubGPIOReadByteResponse) + StubGPIOReadByteResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubGPIOReadByteResponse.newBuilder() to construct. + private StubGPIOReadByteResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubGPIOReadByteResponse() { + portId_ = 0; + byteValue_ = 0; + status_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubGPIOReadByteResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + portId_ = input.readUInt32(); + break; + } + case 16: { + + byteValue_ = input.readUInt32(); + break; + } + case 24: { + + status_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOReadByteResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOReadByteResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse.class, com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse.Builder.class); + } + + public static final int PORTID_FIELD_NUMBER = 1; + private int portId_; + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public int getPortId() { + return portId_; + } + + public static final int BYTEVALUE_FIELD_NUMBER = 2; + private int byteValue_; + /** + * <code>uint32 ByteValue = 2;</code> + */ + public int getByteValue() { + return byteValue_; + } + + public static final int STATUS_FIELD_NUMBER = 3; + private boolean status_; + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool status = 3;</code> + */ + public boolean getStatus() { + return status_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (portId_ != 0) { + output.writeUInt32(1, portId_); + } + if (byteValue_ != 0) { + output.writeUInt32(2, byteValue_); + } + if (status_ != false) { + output.writeBool(3, status_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (portId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, portId_); + } + if (byteValue_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, byteValue_); + } + if (status_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, status_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse other = (com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse) obj; + + boolean result = true; + result = result && (getPortId() + == other.getPortId()); + result = result && (getByteValue() + == other.getByteValue()); + result = result && (getStatus() + == other.getStatus()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PORTID_FIELD_NUMBER; + hash = (53 * hash) + getPortId(); + hash = (37 * hash) + BYTEVALUE_FIELD_NUMBER; + hash = (53 * hash) + getByteValue(); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getStatus()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubGPIOReadByteResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubGPIOReadByteResponse) + com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOReadByteResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOReadByteResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse.class, com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + portId_ = 0; + + byteValue_ = 0; + + status_ = false; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOReadByteResponse_descriptor; + } + + public com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse build() { + com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse buildPartial() { + com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse result = new com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse(this); + result.portId_ = portId_; + result.byteValue_ = byteValue_; + result.status_ = status_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse) { + return mergeFrom((com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse other) { + if (other == com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse.getDefaultInstance()) return this; + if (other.getPortId() != 0) { + setPortId(other.getPortId()); + } + if (other.getByteValue() != 0) { + setByteValue(other.getByteValue()); + } + if (other.getStatus() != false) { + setStatus(other.getStatus()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int portId_ ; + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public int getPortId() { + return portId_; + } + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public Builder setPortId(int value) { + + portId_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public Builder clearPortId() { + + portId_ = 0; + onChanged(); + return this; + } + + private int byteValue_ ; + /** + * <code>uint32 ByteValue = 2;</code> + */ + public int getByteValue() { + return byteValue_; + } + /** + * <code>uint32 ByteValue = 2;</code> + */ + public Builder setByteValue(int value) { + + byteValue_ = value; + onChanged(); + return this; + } + /** + * <code>uint32 ByteValue = 2;</code> + */ + public Builder clearByteValue() { + + byteValue_ = 0; + onChanged(); + return this; + } + + private boolean status_ ; + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool status = 3;</code> + */ + public boolean getStatus() { + return status_; + } + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool status = 3;</code> + */ + public Builder setStatus(boolean value) { + + status_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool status = 3;</code> + */ + public Builder clearStatus() { + + status_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubGPIOReadByteResponse) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubGPIOReadByteResponse) + private static final com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse(); + } + + public static com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubGPIOReadByteResponse> + PARSER = new com.google.protobuf.AbstractParser<StubGPIOReadByteResponse>() { + public StubGPIOReadByteResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubGPIOReadByteResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubGPIOReadByteResponse> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubGPIOReadByteResponse> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubGPIOReadByteResponseOuterClass.StubGPIOReadByteResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubGPIOReadByteResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubGPIOReadByteResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\036StubGPIOReadByteResponse.proto\022\017Tango." + + "PMR.Stubs\"M\n\030StubGPIOReadByteResponse\022\016\n" + + "\006PortId\030\001 \001(\r\022\021\n\tByteValue\030\002 \001(\r\022\016\n\006stat" + + "us\030\003 \001(\010B\033\n\031com.twine.tango.pmr.stubsb\006p" + + "roto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubGPIOReadByteResponse_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubGPIOReadByteResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubGPIOReadByteResponse_descriptor, + new java.lang.String[] { "PortId", "ByteValue", "Status", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteBitRequestOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteBitRequestOuterClass.java new file mode 100644 index 000000000..7672c3cbb --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteBitRequestOuterClass.java @@ -0,0 +1,673 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubGPIOWriteBitRequest.proto + +package com.twine.tango.pmr.stubs; + +public final class StubGPIOWriteBitRequestOuterClass { + private StubGPIOWriteBitRequestOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubGPIOWriteBitRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubGPIOWriteBitRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + int getPortId(); + + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 PinId = 2;</code> + */ + int getPinId(); + + /** + * <code>bool BitToWrite = 3;</code> + */ + boolean getBitToWrite(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubGPIOWriteBitRequest} + */ + public static final class StubGPIOWriteBitRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubGPIOWriteBitRequest) + StubGPIOWriteBitRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubGPIOWriteBitRequest.newBuilder() to construct. + private StubGPIOWriteBitRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubGPIOWriteBitRequest() { + portId_ = 0; + pinId_ = 0; + bitToWrite_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubGPIOWriteBitRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + portId_ = input.readUInt32(); + break; + } + case 16: { + + pinId_ = input.readUInt32(); + break; + } + case 24: { + + bitToWrite_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOWriteBitRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOWriteBitRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest.class, com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest.Builder.class); + } + + public static final int PORTID_FIELD_NUMBER = 1; + private int portId_; + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public int getPortId() { + return portId_; + } + + public static final int PINID_FIELD_NUMBER = 2; + private int pinId_; + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 PinId = 2;</code> + */ + public int getPinId() { + return pinId_; + } + + public static final int BITTOWRITE_FIELD_NUMBER = 3; + private boolean bitToWrite_; + /** + * <code>bool BitToWrite = 3;</code> + */ + public boolean getBitToWrite() { + return bitToWrite_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (portId_ != 0) { + output.writeUInt32(1, portId_); + } + if (pinId_ != 0) { + output.writeUInt32(2, pinId_); + } + if (bitToWrite_ != false) { + output.writeBool(3, bitToWrite_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (portId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, portId_); + } + if (pinId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, pinId_); + } + if (bitToWrite_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, bitToWrite_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest other = (com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest) obj; + + boolean result = true; + result = result && (getPortId() + == other.getPortId()); + result = result && (getPinId() + == other.getPinId()); + result = result && (getBitToWrite() + == other.getBitToWrite()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PORTID_FIELD_NUMBER; + hash = (53 * hash) + getPortId(); + hash = (37 * hash) + PINID_FIELD_NUMBER; + hash = (53 * hash) + getPinId(); + hash = (37 * hash) + BITTOWRITE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getBitToWrite()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubGPIOWriteBitRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubGPIOWriteBitRequest) + com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOWriteBitRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOWriteBitRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest.class, com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + portId_ = 0; + + pinId_ = 0; + + bitToWrite_ = false; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOWriteBitRequest_descriptor; + } + + public com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest build() { + com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest buildPartial() { + com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest result = new com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest(this); + result.portId_ = portId_; + result.pinId_ = pinId_; + result.bitToWrite_ = bitToWrite_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest) { + return mergeFrom((com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest other) { + if (other == com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest.getDefaultInstance()) return this; + if (other.getPortId() != 0) { + setPortId(other.getPortId()); + } + if (other.getPinId() != 0) { + setPinId(other.getPinId()); + } + if (other.getBitToWrite() != false) { + setBitToWrite(other.getBitToWrite()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int portId_ ; + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public int getPortId() { + return portId_; + } + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public Builder setPortId(int value) { + + portId_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public Builder clearPortId() { + + portId_ = 0; + onChanged(); + return this; + } + + private int pinId_ ; + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 PinId = 2;</code> + */ + public int getPinId() { + return pinId_; + } + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 PinId = 2;</code> + */ + public Builder setPinId(int value) { + + pinId_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 PinId = 2;</code> + */ + public Builder clearPinId() { + + pinId_ = 0; + onChanged(); + return this; + } + + private boolean bitToWrite_ ; + /** + * <code>bool BitToWrite = 3;</code> + */ + public boolean getBitToWrite() { + return bitToWrite_; + } + /** + * <code>bool BitToWrite = 3;</code> + */ + public Builder setBitToWrite(boolean value) { + + bitToWrite_ = value; + onChanged(); + return this; + } + /** + * <code>bool BitToWrite = 3;</code> + */ + public Builder clearBitToWrite() { + + bitToWrite_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubGPIOWriteBitRequest) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubGPIOWriteBitRequest) + private static final com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest(); + } + + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubGPIOWriteBitRequest> + PARSER = new com.google.protobuf.AbstractParser<StubGPIOWriteBitRequest>() { + public StubGPIOWriteBitRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubGPIOWriteBitRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubGPIOWriteBitRequest> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubGPIOWriteBitRequest> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubGPIOWriteBitRequestOuterClass.StubGPIOWriteBitRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubGPIOWriteBitRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubGPIOWriteBitRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\035StubGPIOWriteBitRequest.proto\022\017Tango.P" + + "MR.Stubs\"L\n\027StubGPIOWriteBitRequest\022\016\n\006P" + + "ortId\030\001 \001(\r\022\r\n\005PinId\030\002 \001(\r\022\022\n\nBitToWrite" + + "\030\003 \001(\010B\033\n\031com.twine.tango.pmr.stubsb\006pro" + + "to3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubGPIOWriteBitRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubGPIOWriteBitRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubGPIOWriteBitRequest_descriptor, + new java.lang.String[] { "PortId", "PinId", "BitToWrite", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteBitResponseOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteBitResponseOuterClass.java new file mode 100644 index 000000000..cfc6f784c --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteBitResponseOuterClass.java @@ -0,0 +1,693 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubGPIOWriteBitResponse.proto + +package com.twine.tango.pmr.stubs; + +public final class StubGPIOWriteBitResponseOuterClass { + private StubGPIOWriteBitResponseOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubGPIOWriteBitResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubGPIOWriteBitResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + int getPortId(); + + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 PinId = 2;</code> + */ + int getPinId(); + + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + boolean getStatus(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubGPIOWriteBitResponse} + */ + public static final class StubGPIOWriteBitResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubGPIOWriteBitResponse) + StubGPIOWriteBitResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubGPIOWriteBitResponse.newBuilder() to construct. + private StubGPIOWriteBitResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubGPIOWriteBitResponse() { + portId_ = 0; + pinId_ = 0; + status_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubGPIOWriteBitResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + portId_ = input.readUInt32(); + break; + } + case 16: { + + pinId_ = input.readUInt32(); + break; + } + case 24: { + + status_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOWriteBitResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOWriteBitResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse.class, com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse.Builder.class); + } + + public static final int PORTID_FIELD_NUMBER = 1; + private int portId_; + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public int getPortId() { + return portId_; + } + + public static final int PINID_FIELD_NUMBER = 2; + private int pinId_; + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 PinId = 2;</code> + */ + public int getPinId() { + return pinId_; + } + + public static final int STATUS_FIELD_NUMBER = 3; + private boolean status_; + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + public boolean getStatus() { + return status_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (portId_ != 0) { + output.writeUInt32(1, portId_); + } + if (pinId_ != 0) { + output.writeUInt32(2, pinId_); + } + if (status_ != false) { + output.writeBool(3, status_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (portId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, portId_); + } + if (pinId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, pinId_); + } + if (status_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, status_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse other = (com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse) obj; + + boolean result = true; + result = result && (getPortId() + == other.getPortId()); + result = result && (getPinId() + == other.getPinId()); + result = result && (getStatus() + == other.getStatus()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PORTID_FIELD_NUMBER; + hash = (53 * hash) + getPortId(); + hash = (37 * hash) + PINID_FIELD_NUMBER; + hash = (53 * hash) + getPinId(); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getStatus()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubGPIOWriteBitResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubGPIOWriteBitResponse) + com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOWriteBitResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOWriteBitResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse.class, com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + portId_ = 0; + + pinId_ = 0; + + status_ = false; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOWriteBitResponse_descriptor; + } + + public com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse build() { + com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse buildPartial() { + com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse result = new com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse(this); + result.portId_ = portId_; + result.pinId_ = pinId_; + result.status_ = status_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse) { + return mergeFrom((com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse other) { + if (other == com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse.getDefaultInstance()) return this; + if (other.getPortId() != 0) { + setPortId(other.getPortId()); + } + if (other.getPinId() != 0) { + setPinId(other.getPinId()); + } + if (other.getStatus() != false) { + setStatus(other.getStatus()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int portId_ ; + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public int getPortId() { + return portId_; + } + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public Builder setPortId(int value) { + + portId_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public Builder clearPortId() { + + portId_ = 0; + onChanged(); + return this; + } + + private int pinId_ ; + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 PinId = 2;</code> + */ + public int getPinId() { + return pinId_; + } + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 PinId = 2;</code> + */ + public Builder setPinId(int value) { + + pinId_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0..7 + * </pre> + * + * <code>uint32 PinId = 2;</code> + */ + public Builder clearPinId() { + + pinId_ = 0; + onChanged(); + return this; + } + + private boolean status_ ; + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + public boolean getStatus() { + return status_; + } + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + public Builder setStatus(boolean value) { + + status_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + public Builder clearStatus() { + + status_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubGPIOWriteBitResponse) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubGPIOWriteBitResponse) + private static final com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse(); + } + + public static com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubGPIOWriteBitResponse> + PARSER = new com.google.protobuf.AbstractParser<StubGPIOWriteBitResponse>() { + public StubGPIOWriteBitResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubGPIOWriteBitResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubGPIOWriteBitResponse> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubGPIOWriteBitResponse> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubGPIOWriteBitResponseOuterClass.StubGPIOWriteBitResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubGPIOWriteBitResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubGPIOWriteBitResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\036StubGPIOWriteBitResponse.proto\022\017Tango." + + "PMR.Stubs\"I\n\030StubGPIOWriteBitResponse\022\016\n" + + "\006PortId\030\001 \001(\r\022\r\n\005PinId\030\002 \001(\r\022\016\n\006Status\030\003" + + " \001(\010B\033\n\031com.twine.tango.pmr.stubsb\006proto" + + "3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubGPIOWriteBitResponse_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubGPIOWriteBitResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubGPIOWriteBitResponse_descriptor, + new java.lang.String[] { "PortId", "PinId", "Status", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteByteRequestOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteByteRequestOuterClass.java new file mode 100644 index 000000000..ee9e8d42e --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteByteRequestOuterClass.java @@ -0,0 +1,588 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubGPIOWriteByteRequest.proto + +package com.twine.tango.pmr.stubs; + +public final class StubGPIOWriteByteRequestOuterClass { + private StubGPIOWriteByteRequestOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubGPIOWriteByteRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubGPIOWriteByteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + int getPortId(); + + /** + * <code>uint32 DataToWrite = 3;</code> + */ + int getDataToWrite(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubGPIOWriteByteRequest} + */ + public static final class StubGPIOWriteByteRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubGPIOWriteByteRequest) + StubGPIOWriteByteRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubGPIOWriteByteRequest.newBuilder() to construct. + private StubGPIOWriteByteRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubGPIOWriteByteRequest() { + portId_ = 0; + dataToWrite_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubGPIOWriteByteRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + portId_ = input.readUInt32(); + break; + } + case 24: { + + dataToWrite_ = input.readUInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOWriteByteRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOWriteByteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest.class, com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest.Builder.class); + } + + public static final int PORTID_FIELD_NUMBER = 1; + private int portId_; + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public int getPortId() { + return portId_; + } + + public static final int DATATOWRITE_FIELD_NUMBER = 3; + private int dataToWrite_; + /** + * <code>uint32 DataToWrite = 3;</code> + */ + public int getDataToWrite() { + return dataToWrite_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (portId_ != 0) { + output.writeUInt32(1, portId_); + } + if (dataToWrite_ != 0) { + output.writeUInt32(3, dataToWrite_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (portId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, portId_); + } + if (dataToWrite_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, dataToWrite_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest other = (com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest) obj; + + boolean result = true; + result = result && (getPortId() + == other.getPortId()); + result = result && (getDataToWrite() + == other.getDataToWrite()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PORTID_FIELD_NUMBER; + hash = (53 * hash) + getPortId(); + hash = (37 * hash) + DATATOWRITE_FIELD_NUMBER; + hash = (53 * hash) + getDataToWrite(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubGPIOWriteByteRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubGPIOWriteByteRequest) + com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOWriteByteRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOWriteByteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest.class, com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + portId_ = 0; + + dataToWrite_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOWriteByteRequest_descriptor; + } + + public com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest build() { + com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest buildPartial() { + com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest result = new com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest(this); + result.portId_ = portId_; + result.dataToWrite_ = dataToWrite_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest) { + return mergeFrom((com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest other) { + if (other == com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest.getDefaultInstance()) return this; + if (other.getPortId() != 0) { + setPortId(other.getPortId()); + } + if (other.getDataToWrite() != 0) { + setDataToWrite(other.getDataToWrite()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int portId_ ; + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public int getPortId() { + return portId_; + } + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public Builder setPortId(int value) { + + portId_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public Builder clearPortId() { + + portId_ = 0; + onChanged(); + return this; + } + + private int dataToWrite_ ; + /** + * <code>uint32 DataToWrite = 3;</code> + */ + public int getDataToWrite() { + return dataToWrite_; + } + /** + * <code>uint32 DataToWrite = 3;</code> + */ + public Builder setDataToWrite(int value) { + + dataToWrite_ = value; + onChanged(); + return this; + } + /** + * <code>uint32 DataToWrite = 3;</code> + */ + public Builder clearDataToWrite() { + + dataToWrite_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubGPIOWriteByteRequest) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubGPIOWriteByteRequest) + private static final com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest(); + } + + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubGPIOWriteByteRequest> + PARSER = new com.google.protobuf.AbstractParser<StubGPIOWriteByteRequest>() { + public StubGPIOWriteByteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubGPIOWriteByteRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubGPIOWriteByteRequest> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubGPIOWriteByteRequest> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubGPIOWriteByteRequestOuterClass.StubGPIOWriteByteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubGPIOWriteByteRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubGPIOWriteByteRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\036StubGPIOWriteByteRequest.proto\022\017Tango." + + "PMR.Stubs\"?\n\030StubGPIOWriteByteRequest\022\016\n" + + "\006PortId\030\001 \001(\r\022\023\n\013DataToWrite\030\003 \001(\rB\033\n\031co" + + "m.twine.tango.pmr.stubsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubGPIOWriteByteRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubGPIOWriteByteRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubGPIOWriteByteRequest_descriptor, + new java.lang.String[] { "PortId", "DataToWrite", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteByteResponseOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteByteResponseOuterClass.java new file mode 100644 index 000000000..d1ce9ca45 --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubGPIOWriteByteResponseOuterClass.java @@ -0,0 +1,609 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubGPIOWriteByteResponse.proto + +package com.twine.tango.pmr.stubs; + +public final class StubGPIOWriteByteResponseOuterClass { + private StubGPIOWriteByteResponseOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubGPIOWriteByteResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubGPIOWriteByteResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + int getPortId(); + + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool status = 3;</code> + */ + boolean getStatus(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubGPIOWriteByteResponse} + */ + public static final class StubGPIOWriteByteResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubGPIOWriteByteResponse) + StubGPIOWriteByteResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubGPIOWriteByteResponse.newBuilder() to construct. + private StubGPIOWriteByteResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubGPIOWriteByteResponse() { + portId_ = 0; + status_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubGPIOWriteByteResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + portId_ = input.readUInt32(); + break; + } + case 24: { + + status_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOWriteByteResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOWriteByteResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse.class, com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse.Builder.class); + } + + public static final int PORTID_FIELD_NUMBER = 1; + private int portId_; + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public int getPortId() { + return portId_; + } + + public static final int STATUS_FIELD_NUMBER = 3; + private boolean status_; + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool status = 3;</code> + */ + public boolean getStatus() { + return status_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (portId_ != 0) { + output.writeUInt32(1, portId_); + } + if (status_ != false) { + output.writeBool(3, status_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (portId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, portId_); + } + if (status_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, status_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse other = (com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse) obj; + + boolean result = true; + result = result && (getPortId() + == other.getPortId()); + result = result && (getStatus() + == other.getStatus()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PORTID_FIELD_NUMBER; + hash = (53 * hash) + getPortId(); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getStatus()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubGPIOWriteByteResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubGPIOWriteByteResponse) + com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOWriteByteResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOWriteByteResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse.class, com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + portId_ = 0; + + status_ = false; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.internal_static_Tango_PMR_Stubs_StubGPIOWriteByteResponse_descriptor; + } + + public com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse build() { + com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse buildPartial() { + com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse result = new com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse(this); + result.portId_ = portId_; + result.status_ = status_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse) { + return mergeFrom((com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse other) { + if (other == com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse.getDefaultInstance()) return this; + if (other.getPortId() != 0) { + setPortId(other.getPortId()); + } + if (other.getStatus() != false) { + setStatus(other.getStatus()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int portId_ ; + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public int getPortId() { + return portId_; + } + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public Builder setPortId(int value) { + + portId_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0..119 + * </pre> + * + * <code>uint32 PortId = 1;</code> + */ + public Builder clearPortId() { + + portId_ = 0; + onChanged(); + return this; + } + + private boolean status_ ; + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool status = 3;</code> + */ + public boolean getStatus() { + return status_; + } + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool status = 3;</code> + */ + public Builder setStatus(boolean value) { + + status_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool status = 3;</code> + */ + public Builder clearStatus() { + + status_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubGPIOWriteByteResponse) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubGPIOWriteByteResponse) + private static final com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse(); + } + + public static com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubGPIOWriteByteResponse> + PARSER = new com.google.protobuf.AbstractParser<StubGPIOWriteByteResponse>() { + public StubGPIOWriteByteResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubGPIOWriteByteResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubGPIOWriteByteResponse> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubGPIOWriteByteResponse> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubGPIOWriteByteResponseOuterClass.StubGPIOWriteByteResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubGPIOWriteByteResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubGPIOWriteByteResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\037StubGPIOWriteByteResponse.proto\022\017Tango" + + ".PMR.Stubs\";\n\031StubGPIOWriteByteResponse\022" + + "\016\n\006PortId\030\001 \001(\r\022\016\n\006status\030\003 \001(\010B\033\n\031com.t" + + "wine.tango.pmr.stubsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubGPIOWriteByteResponse_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubGPIOWriteByteResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubGPIOWriteByteResponse_descriptor, + new java.lang.String[] { "PortId", "Status", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubHeaterRequestOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubHeaterRequestOuterClass.java new file mode 100644 index 000000000..a443addbb --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubHeaterRequestOuterClass.java @@ -0,0 +1,673 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubHeaterRequest.proto + +package com.twine.tango.pmr.stubs; + +public final class StubHeaterRequestOuterClass { + private StubHeaterRequestOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubHeaterRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubHeaterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * <pre> + *0..2 + * </pre> + * + * <code>uint32 HeaterGroupId = 1;</code> + */ + int getHeaterGroupId(); + + /** + * <pre> + * 1-On 0-Off + * </pre> + * + * <code>bool HeaterGroupOn = 2;</code> + */ + boolean getHeaterGroupOn(); + + /** + * <code>uint32 HeaterTemperatureReq = 3;</code> + */ + int getHeaterTemperatureReq(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubHeaterRequest} + */ + public static final class StubHeaterRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubHeaterRequest) + StubHeaterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubHeaterRequest.newBuilder() to construct. + private StubHeaterRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubHeaterRequest() { + heaterGroupId_ = 0; + heaterGroupOn_ = false; + heaterTemperatureReq_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubHeaterRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + heaterGroupId_ = input.readUInt32(); + break; + } + case 16: { + + heaterGroupOn_ = input.readBool(); + break; + } + case 24: { + + heaterTemperatureReq_ = input.readUInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.internal_static_Tango_PMR_Stubs_StubHeaterRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.internal_static_Tango_PMR_Stubs_StubHeaterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest.class, com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest.Builder.class); + } + + public static final int HEATERGROUPID_FIELD_NUMBER = 1; + private int heaterGroupId_; + /** + * <pre> + *0..2 + * </pre> + * + * <code>uint32 HeaterGroupId = 1;</code> + */ + public int getHeaterGroupId() { + return heaterGroupId_; + } + + public static final int HEATERGROUPON_FIELD_NUMBER = 2; + private boolean heaterGroupOn_; + /** + * <pre> + * 1-On 0-Off + * </pre> + * + * <code>bool HeaterGroupOn = 2;</code> + */ + public boolean getHeaterGroupOn() { + return heaterGroupOn_; + } + + public static final int HEATERTEMPERATUREREQ_FIELD_NUMBER = 3; + private int heaterTemperatureReq_; + /** + * <code>uint32 HeaterTemperatureReq = 3;</code> + */ + public int getHeaterTemperatureReq() { + return heaterTemperatureReq_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (heaterGroupId_ != 0) { + output.writeUInt32(1, heaterGroupId_); + } + if (heaterGroupOn_ != false) { + output.writeBool(2, heaterGroupOn_); + } + if (heaterTemperatureReq_ != 0) { + output.writeUInt32(3, heaterTemperatureReq_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (heaterGroupId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, heaterGroupId_); + } + if (heaterGroupOn_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, heaterGroupOn_); + } + if (heaterTemperatureReq_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, heaterTemperatureReq_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest other = (com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest) obj; + + boolean result = true; + result = result && (getHeaterGroupId() + == other.getHeaterGroupId()); + result = result && (getHeaterGroupOn() + == other.getHeaterGroupOn()); + result = result && (getHeaterTemperatureReq() + == other.getHeaterTemperatureReq()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + HEATERGROUPID_FIELD_NUMBER; + hash = (53 * hash) + getHeaterGroupId(); + hash = (37 * hash) + HEATERGROUPON_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getHeaterGroupOn()); + hash = (37 * hash) + HEATERTEMPERATUREREQ_FIELD_NUMBER; + hash = (53 * hash) + getHeaterTemperatureReq(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubHeaterRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubHeaterRequest) + com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.internal_static_Tango_PMR_Stubs_StubHeaterRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.internal_static_Tango_PMR_Stubs_StubHeaterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest.class, com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + heaterGroupId_ = 0; + + heaterGroupOn_ = false; + + heaterTemperatureReq_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.internal_static_Tango_PMR_Stubs_StubHeaterRequest_descriptor; + } + + public com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest build() { + com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest buildPartial() { + com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest result = new com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest(this); + result.heaterGroupId_ = heaterGroupId_; + result.heaterGroupOn_ = heaterGroupOn_; + result.heaterTemperatureReq_ = heaterTemperatureReq_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest) { + return mergeFrom((com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest other) { + if (other == com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest.getDefaultInstance()) return this; + if (other.getHeaterGroupId() != 0) { + setHeaterGroupId(other.getHeaterGroupId()); + } + if (other.getHeaterGroupOn() != false) { + setHeaterGroupOn(other.getHeaterGroupOn()); + } + if (other.getHeaterTemperatureReq() != 0) { + setHeaterTemperatureReq(other.getHeaterTemperatureReq()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int heaterGroupId_ ; + /** + * <pre> + *0..2 + * </pre> + * + * <code>uint32 HeaterGroupId = 1;</code> + */ + public int getHeaterGroupId() { + return heaterGroupId_; + } + /** + * <pre> + *0..2 + * </pre> + * + * <code>uint32 HeaterGroupId = 1;</code> + */ + public Builder setHeaterGroupId(int value) { + + heaterGroupId_ = value; + onChanged(); + return this; + } + /** + * <pre> + *0..2 + * </pre> + * + * <code>uint32 HeaterGroupId = 1;</code> + */ + public Builder clearHeaterGroupId() { + + heaterGroupId_ = 0; + onChanged(); + return this; + } + + private boolean heaterGroupOn_ ; + /** + * <pre> + * 1-On 0-Off + * </pre> + * + * <code>bool HeaterGroupOn = 2;</code> + */ + public boolean getHeaterGroupOn() { + return heaterGroupOn_; + } + /** + * <pre> + * 1-On 0-Off + * </pre> + * + * <code>bool HeaterGroupOn = 2;</code> + */ + public Builder setHeaterGroupOn(boolean value) { + + heaterGroupOn_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 1-On 0-Off + * </pre> + * + * <code>bool HeaterGroupOn = 2;</code> + */ + public Builder clearHeaterGroupOn() { + + heaterGroupOn_ = false; + onChanged(); + return this; + } + + private int heaterTemperatureReq_ ; + /** + * <code>uint32 HeaterTemperatureReq = 3;</code> + */ + public int getHeaterTemperatureReq() { + return heaterTemperatureReq_; + } + /** + * <code>uint32 HeaterTemperatureReq = 3;</code> + */ + public Builder setHeaterTemperatureReq(int value) { + + heaterTemperatureReq_ = value; + onChanged(); + return this; + } + /** + * <code>uint32 HeaterTemperatureReq = 3;</code> + */ + public Builder clearHeaterTemperatureReq() { + + heaterTemperatureReq_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubHeaterRequest) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubHeaterRequest) + private static final com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest(); + } + + public static com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubHeaterRequest> + PARSER = new com.google.protobuf.AbstractParser<StubHeaterRequest>() { + public StubHeaterRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubHeaterRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubHeaterRequest> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubHeaterRequest> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubHeaterRequestOuterClass.StubHeaterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubHeaterRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubHeaterRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\027StubHeaterRequest.proto\022\017Tango.PMR.Stu" + + "bs\"_\n\021StubHeaterRequest\022\025\n\rHeaterGroupId" + + "\030\001 \001(\r\022\025\n\rHeaterGroupOn\030\002 \001(\010\022\034\n\024HeaterT" + + "emperatureReq\030\003 \001(\rB\033\n\031com.twine.tango.p" + + "mr.stubsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubHeaterRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubHeaterRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubHeaterRequest_descriptor, + new java.lang.String[] { "HeaterGroupId", "HeaterGroupOn", "HeaterTemperatureReq", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubHeaterResponseOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubHeaterResponseOuterClass.java new file mode 100644 index 000000000..875b1aeac --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubHeaterResponseOuterClass.java @@ -0,0 +1,673 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubHeaterResponse.proto + +package com.twine.tango.pmr.stubs; + +public final class StubHeaterResponseOuterClass { + private StubHeaterResponseOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubHeaterResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubHeaterResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * <pre> + *0..2 + * </pre> + * + * <code>uint32 HeaterGroupId = 1;</code> + */ + int getHeaterGroupId(); + + /** + * <code>uint32 HeaterTemperatureSensor = 2;</code> + */ + int getHeaterTemperatureSensor(); + + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + boolean getStatus(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubHeaterResponse} + */ + public static final class StubHeaterResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubHeaterResponse) + StubHeaterResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubHeaterResponse.newBuilder() to construct. + private StubHeaterResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubHeaterResponse() { + heaterGroupId_ = 0; + heaterTemperatureSensor_ = 0; + status_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubHeaterResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + heaterGroupId_ = input.readUInt32(); + break; + } + case 16: { + + heaterTemperatureSensor_ = input.readUInt32(); + break; + } + case 24: { + + status_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.internal_static_Tango_PMR_Stubs_StubHeaterResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.internal_static_Tango_PMR_Stubs_StubHeaterResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse.class, com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse.Builder.class); + } + + public static final int HEATERGROUPID_FIELD_NUMBER = 1; + private int heaterGroupId_; + /** + * <pre> + *0..2 + * </pre> + * + * <code>uint32 HeaterGroupId = 1;</code> + */ + public int getHeaterGroupId() { + return heaterGroupId_; + } + + public static final int HEATERTEMPERATURESENSOR_FIELD_NUMBER = 2; + private int heaterTemperatureSensor_; + /** + * <code>uint32 HeaterTemperatureSensor = 2;</code> + */ + public int getHeaterTemperatureSensor() { + return heaterTemperatureSensor_; + } + + public static final int STATUS_FIELD_NUMBER = 3; + private boolean status_; + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + public boolean getStatus() { + return status_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (heaterGroupId_ != 0) { + output.writeUInt32(1, heaterGroupId_); + } + if (heaterTemperatureSensor_ != 0) { + output.writeUInt32(2, heaterTemperatureSensor_); + } + if (status_ != false) { + output.writeBool(3, status_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (heaterGroupId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, heaterGroupId_); + } + if (heaterTemperatureSensor_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, heaterTemperatureSensor_); + } + if (status_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, status_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse other = (com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse) obj; + + boolean result = true; + result = result && (getHeaterGroupId() + == other.getHeaterGroupId()); + result = result && (getHeaterTemperatureSensor() + == other.getHeaterTemperatureSensor()); + result = result && (getStatus() + == other.getStatus()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + HEATERGROUPID_FIELD_NUMBER; + hash = (53 * hash) + getHeaterGroupId(); + hash = (37 * hash) + HEATERTEMPERATURESENSOR_FIELD_NUMBER; + hash = (53 * hash) + getHeaterTemperatureSensor(); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getStatus()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubHeaterResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubHeaterResponse) + com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.internal_static_Tango_PMR_Stubs_StubHeaterResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.internal_static_Tango_PMR_Stubs_StubHeaterResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse.class, com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + heaterGroupId_ = 0; + + heaterTemperatureSensor_ = 0; + + status_ = false; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.internal_static_Tango_PMR_Stubs_StubHeaterResponse_descriptor; + } + + public com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse build() { + com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse buildPartial() { + com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse result = new com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse(this); + result.heaterGroupId_ = heaterGroupId_; + result.heaterTemperatureSensor_ = heaterTemperatureSensor_; + result.status_ = status_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse) { + return mergeFrom((com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse other) { + if (other == com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse.getDefaultInstance()) return this; + if (other.getHeaterGroupId() != 0) { + setHeaterGroupId(other.getHeaterGroupId()); + } + if (other.getHeaterTemperatureSensor() != 0) { + setHeaterTemperatureSensor(other.getHeaterTemperatureSensor()); + } + if (other.getStatus() != false) { + setStatus(other.getStatus()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int heaterGroupId_ ; + /** + * <pre> + *0..2 + * </pre> + * + * <code>uint32 HeaterGroupId = 1;</code> + */ + public int getHeaterGroupId() { + return heaterGroupId_; + } + /** + * <pre> + *0..2 + * </pre> + * + * <code>uint32 HeaterGroupId = 1;</code> + */ + public Builder setHeaterGroupId(int value) { + + heaterGroupId_ = value; + onChanged(); + return this; + } + /** + * <pre> + *0..2 + * </pre> + * + * <code>uint32 HeaterGroupId = 1;</code> + */ + public Builder clearHeaterGroupId() { + + heaterGroupId_ = 0; + onChanged(); + return this; + } + + private int heaterTemperatureSensor_ ; + /** + * <code>uint32 HeaterTemperatureSensor = 2;</code> + */ + public int getHeaterTemperatureSensor() { + return heaterTemperatureSensor_; + } + /** + * <code>uint32 HeaterTemperatureSensor = 2;</code> + */ + public Builder setHeaterTemperatureSensor(int value) { + + heaterTemperatureSensor_ = value; + onChanged(); + return this; + } + /** + * <code>uint32 HeaterTemperatureSensor = 2;</code> + */ + public Builder clearHeaterTemperatureSensor() { + + heaterTemperatureSensor_ = 0; + onChanged(); + return this; + } + + private boolean status_ ; + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + public boolean getStatus() { + return status_; + } + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + public Builder setStatus(boolean value) { + + status_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + public Builder clearStatus() { + + status_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubHeaterResponse) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubHeaterResponse) + private static final com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse(); + } + + public static com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubHeaterResponse> + PARSER = new com.google.protobuf.AbstractParser<StubHeaterResponse>() { + public StubHeaterResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubHeaterResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubHeaterResponse> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubHeaterResponse> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubHeaterResponseOuterClass.StubHeaterResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubHeaterResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubHeaterResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\030StubHeaterResponse.proto\022\017Tango.PMR.St" + + "ubs\"\\\n\022StubHeaterResponse\022\025\n\rHeaterGroup" + + "Id\030\001 \001(\r\022\037\n\027HeaterTemperatureSensor\030\002 \001(" + + "\r\022\016\n\006Status\030\003 \001(\010B\033\n\031com.twine.tango.pmr" + + ".stubsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubHeaterResponse_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubHeaterResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubHeaterResponse_descriptor, + new java.lang.String[] { "HeaterGroupId", "HeaterTemperatureSensor", "Status", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubMotorEncoderRequestOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubMotorEncoderRequestOuterClass.java new file mode 100644 index 000000000..f55007864 --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubMotorEncoderRequestOuterClass.java @@ -0,0 +1,758 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubMotorEncoderRequest.proto + +package com.twine.tango.pmr.stubs; + +public final class StubMotorEncoderRequestOuterClass { + private StubMotorEncoderRequestOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubMotorEncoderRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubMotorEncoderRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * <pre> + *0..8 + * </pre> + * + * <code>uint32 MotorId = 1;</code> + */ + int getMotorId(); + + /** + * <code>bool ReadEncSpeed = 2;</code> + */ + boolean getReadEncSpeed(); + + /** + * <pre> + * 1-cw 0-ccw + * </pre> + * + * <code>bool ReadDirection = 3;</code> + */ + boolean getReadDirection(); + + /** + * <pre> + * close loop using the encoder + * </pre> + * + * <code>bool Motion_Control = 4;</code> + */ + boolean getMotionControl(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubMotorEncoderRequest} + */ + public static final class StubMotorEncoderRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubMotorEncoderRequest) + StubMotorEncoderRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubMotorEncoderRequest.newBuilder() to construct. + private StubMotorEncoderRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubMotorEncoderRequest() { + motorId_ = 0; + readEncSpeed_ = false; + readDirection_ = false; + motionControl_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubMotorEncoderRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + motorId_ = input.readUInt32(); + break; + } + case 16: { + + readEncSpeed_ = input.readBool(); + break; + } + case 24: { + + readDirection_ = input.readBool(); + break; + } + case 32: { + + motionControl_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.internal_static_Tango_PMR_Stubs_StubMotorEncoderRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.internal_static_Tango_PMR_Stubs_StubMotorEncoderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest.class, com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest.Builder.class); + } + + public static final int MOTORID_FIELD_NUMBER = 1; + private int motorId_; + /** + * <pre> + *0..8 + * </pre> + * + * <code>uint32 MotorId = 1;</code> + */ + public int getMotorId() { + return motorId_; + } + + public static final int READENCSPEED_FIELD_NUMBER = 2; + private boolean readEncSpeed_; + /** + * <code>bool ReadEncSpeed = 2;</code> + */ + public boolean getReadEncSpeed() { + return readEncSpeed_; + } + + public static final int READDIRECTION_FIELD_NUMBER = 3; + private boolean readDirection_; + /** + * <pre> + * 1-cw 0-ccw + * </pre> + * + * <code>bool ReadDirection = 3;</code> + */ + public boolean getReadDirection() { + return readDirection_; + } + + public static final int MOTION_CONTROL_FIELD_NUMBER = 4; + private boolean motionControl_; + /** + * <pre> + * close loop using the encoder + * </pre> + * + * <code>bool Motion_Control = 4;</code> + */ + public boolean getMotionControl() { + return motionControl_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (motorId_ != 0) { + output.writeUInt32(1, motorId_); + } + if (readEncSpeed_ != false) { + output.writeBool(2, readEncSpeed_); + } + if (readDirection_ != false) { + output.writeBool(3, readDirection_); + } + if (motionControl_ != false) { + output.writeBool(4, motionControl_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (motorId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, motorId_); + } + if (readEncSpeed_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, readEncSpeed_); + } + if (readDirection_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, readDirection_); + } + if (motionControl_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(4, motionControl_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest other = (com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest) obj; + + boolean result = true; + result = result && (getMotorId() + == other.getMotorId()); + result = result && (getReadEncSpeed() + == other.getReadEncSpeed()); + result = result && (getReadDirection() + == other.getReadDirection()); + result = result && (getMotionControl() + == other.getMotionControl()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MOTORID_FIELD_NUMBER; + hash = (53 * hash) + getMotorId(); + hash = (37 * hash) + READENCSPEED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getReadEncSpeed()); + hash = (37 * hash) + READDIRECTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getReadDirection()); + hash = (37 * hash) + MOTION_CONTROL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getMotionControl()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubMotorEncoderRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubMotorEncoderRequest) + com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.internal_static_Tango_PMR_Stubs_StubMotorEncoderRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.internal_static_Tango_PMR_Stubs_StubMotorEncoderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest.class, com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + motorId_ = 0; + + readEncSpeed_ = false; + + readDirection_ = false; + + motionControl_ = false; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.internal_static_Tango_PMR_Stubs_StubMotorEncoderRequest_descriptor; + } + + public com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest build() { + com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest buildPartial() { + com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest result = new com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest(this); + result.motorId_ = motorId_; + result.readEncSpeed_ = readEncSpeed_; + result.readDirection_ = readDirection_; + result.motionControl_ = motionControl_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest) { + return mergeFrom((com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest other) { + if (other == com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest.getDefaultInstance()) return this; + if (other.getMotorId() != 0) { + setMotorId(other.getMotorId()); + } + if (other.getReadEncSpeed() != false) { + setReadEncSpeed(other.getReadEncSpeed()); + } + if (other.getReadDirection() != false) { + setReadDirection(other.getReadDirection()); + } + if (other.getMotionControl() != false) { + setMotionControl(other.getMotionControl()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int motorId_ ; + /** + * <pre> + *0..8 + * </pre> + * + * <code>uint32 MotorId = 1;</code> + */ + public int getMotorId() { + return motorId_; + } + /** + * <pre> + *0..8 + * </pre> + * + * <code>uint32 MotorId = 1;</code> + */ + public Builder setMotorId(int value) { + + motorId_ = value; + onChanged(); + return this; + } + /** + * <pre> + *0..8 + * </pre> + * + * <code>uint32 MotorId = 1;</code> + */ + public Builder clearMotorId() { + + motorId_ = 0; + onChanged(); + return this; + } + + private boolean readEncSpeed_ ; + /** + * <code>bool ReadEncSpeed = 2;</code> + */ + public boolean getReadEncSpeed() { + return readEncSpeed_; + } + /** + * <code>bool ReadEncSpeed = 2;</code> + */ + public Builder setReadEncSpeed(boolean value) { + + readEncSpeed_ = value; + onChanged(); + return this; + } + /** + * <code>bool ReadEncSpeed = 2;</code> + */ + public Builder clearReadEncSpeed() { + + readEncSpeed_ = false; + onChanged(); + return this; + } + + private boolean readDirection_ ; + /** + * <pre> + * 1-cw 0-ccw + * </pre> + * + * <code>bool ReadDirection = 3;</code> + */ + public boolean getReadDirection() { + return readDirection_; + } + /** + * <pre> + * 1-cw 0-ccw + * </pre> + * + * <code>bool ReadDirection = 3;</code> + */ + public Builder setReadDirection(boolean value) { + + readDirection_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 1-cw 0-ccw + * </pre> + * + * <code>bool ReadDirection = 3;</code> + */ + public Builder clearReadDirection() { + + readDirection_ = false; + onChanged(); + return this; + } + + private boolean motionControl_ ; + /** + * <pre> + * close loop using the encoder + * </pre> + * + * <code>bool Motion_Control = 4;</code> + */ + public boolean getMotionControl() { + return motionControl_; + } + /** + * <pre> + * close loop using the encoder + * </pre> + * + * <code>bool Motion_Control = 4;</code> + */ + public Builder setMotionControl(boolean value) { + + motionControl_ = value; + onChanged(); + return this; + } + /** + * <pre> + * close loop using the encoder + * </pre> + * + * <code>bool Motion_Control = 4;</code> + */ + public Builder clearMotionControl() { + + motionControl_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubMotorEncoderRequest) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubMotorEncoderRequest) + private static final com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest(); + } + + public static com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubMotorEncoderRequest> + PARSER = new com.google.protobuf.AbstractParser<StubMotorEncoderRequest>() { + public StubMotorEncoderRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubMotorEncoderRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubMotorEncoderRequest> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubMotorEncoderRequest> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubMotorEncoderRequestOuterClass.StubMotorEncoderRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubMotorEncoderRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubMotorEncoderRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\035StubMotorEncoderRequest.proto\022\017Tango.P" + + "MR.Stubs\"o\n\027StubMotorEncoderRequest\022\017\n\007M" + + "otorId\030\001 \001(\r\022\024\n\014ReadEncSpeed\030\002 \001(\010\022\025\n\rRe" + + "adDirection\030\003 \001(\010\022\026\n\016Motion_Control\030\004 \001(" + + "\010B\033\n\031com.twine.tango.pmr.stubsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubMotorEncoderRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubMotorEncoderRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubMotorEncoderRequest_descriptor, + new java.lang.String[] { "MotorId", "ReadEncSpeed", "ReadDirection", "MotionControl", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubMotorEncoderResponseOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubMotorEncoderResponseOuterClass.java new file mode 100644 index 000000000..9fd3aa229 --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubMotorEncoderResponseOuterClass.java @@ -0,0 +1,821 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubMotorEncoderResponse.proto + +package com.twine.tango.pmr.stubs; + +public final class StubMotorEncoderResponseOuterClass { + private StubMotorEncoderResponseOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubMotorEncoderResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubMotorEncoderResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * <pre> + *0..8 + * </pre> + * + * <code>uint32 EncoderId = 1;</code> + */ + int getEncoderId(); + + /** + * <code>uint32 EncoderVersion = 2;</code> + */ + int getEncoderVersion(); + + /** + * <code>int32 MotorSpeed = 3;</code> + */ + int getMotorSpeed(); + + /** + * <pre> + * 1-cw 0-ccw + * </pre> + * + * <code>bool MotorDirection = 4;</code> + */ + boolean getMotorDirection(); + + /** + * <pre> + * 0-OK 1-Failed ( motion control error > ?) + * </pre> + * + * <code>bool Status = 5;</code> + */ + boolean getStatus(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubMotorEncoderResponse} + */ + public static final class StubMotorEncoderResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubMotorEncoderResponse) + StubMotorEncoderResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubMotorEncoderResponse.newBuilder() to construct. + private StubMotorEncoderResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubMotorEncoderResponse() { + encoderId_ = 0; + encoderVersion_ = 0; + motorSpeed_ = 0; + motorDirection_ = false; + status_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubMotorEncoderResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + encoderId_ = input.readUInt32(); + break; + } + case 16: { + + encoderVersion_ = input.readUInt32(); + break; + } + case 24: { + + motorSpeed_ = input.readInt32(); + break; + } + case 32: { + + motorDirection_ = input.readBool(); + break; + } + case 40: { + + status_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.internal_static_Tango_PMR_Stubs_StubMotorEncoderResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.internal_static_Tango_PMR_Stubs_StubMotorEncoderResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse.class, com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse.Builder.class); + } + + public static final int ENCODERID_FIELD_NUMBER = 1; + private int encoderId_; + /** + * <pre> + *0..8 + * </pre> + * + * <code>uint32 EncoderId = 1;</code> + */ + public int getEncoderId() { + return encoderId_; + } + + public static final int ENCODERVERSION_FIELD_NUMBER = 2; + private int encoderVersion_; + /** + * <code>uint32 EncoderVersion = 2;</code> + */ + public int getEncoderVersion() { + return encoderVersion_; + } + + public static final int MOTORSPEED_FIELD_NUMBER = 3; + private int motorSpeed_; + /** + * <code>int32 MotorSpeed = 3;</code> + */ + public int getMotorSpeed() { + return motorSpeed_; + } + + public static final int MOTORDIRECTION_FIELD_NUMBER = 4; + private boolean motorDirection_; + /** + * <pre> + * 1-cw 0-ccw + * </pre> + * + * <code>bool MotorDirection = 4;</code> + */ + public boolean getMotorDirection() { + return motorDirection_; + } + + public static final int STATUS_FIELD_NUMBER = 5; + private boolean status_; + /** + * <pre> + * 0-OK 1-Failed ( motion control error > ?) + * </pre> + * + * <code>bool Status = 5;</code> + */ + public boolean getStatus() { + return status_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (encoderId_ != 0) { + output.writeUInt32(1, encoderId_); + } + if (encoderVersion_ != 0) { + output.writeUInt32(2, encoderVersion_); + } + if (motorSpeed_ != 0) { + output.writeInt32(3, motorSpeed_); + } + if (motorDirection_ != false) { + output.writeBool(4, motorDirection_); + } + if (status_ != false) { + output.writeBool(5, status_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (encoderId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, encoderId_); + } + if (encoderVersion_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, encoderVersion_); + } + if (motorSpeed_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, motorSpeed_); + } + if (motorDirection_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(4, motorDirection_); + } + if (status_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(5, status_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse other = (com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse) obj; + + boolean result = true; + result = result && (getEncoderId() + == other.getEncoderId()); + result = result && (getEncoderVersion() + == other.getEncoderVersion()); + result = result && (getMotorSpeed() + == other.getMotorSpeed()); + result = result && (getMotorDirection() + == other.getMotorDirection()); + result = result && (getStatus() + == other.getStatus()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENCODERID_FIELD_NUMBER; + hash = (53 * hash) + getEncoderId(); + hash = (37 * hash) + ENCODERVERSION_FIELD_NUMBER; + hash = (53 * hash) + getEncoderVersion(); + hash = (37 * hash) + MOTORSPEED_FIELD_NUMBER; + hash = (53 * hash) + getMotorSpeed(); + hash = (37 * hash) + MOTORDIRECTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getMotorDirection()); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getStatus()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubMotorEncoderResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubMotorEncoderResponse) + com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.internal_static_Tango_PMR_Stubs_StubMotorEncoderResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.internal_static_Tango_PMR_Stubs_StubMotorEncoderResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse.class, com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + encoderId_ = 0; + + encoderVersion_ = 0; + + motorSpeed_ = 0; + + motorDirection_ = false; + + status_ = false; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.internal_static_Tango_PMR_Stubs_StubMotorEncoderResponse_descriptor; + } + + public com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse build() { + com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse buildPartial() { + com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse result = new com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse(this); + result.encoderId_ = encoderId_; + result.encoderVersion_ = encoderVersion_; + result.motorSpeed_ = motorSpeed_; + result.motorDirection_ = motorDirection_; + result.status_ = status_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse) { + return mergeFrom((com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse other) { + if (other == com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse.getDefaultInstance()) return this; + if (other.getEncoderId() != 0) { + setEncoderId(other.getEncoderId()); + } + if (other.getEncoderVersion() != 0) { + setEncoderVersion(other.getEncoderVersion()); + } + if (other.getMotorSpeed() != 0) { + setMotorSpeed(other.getMotorSpeed()); + } + if (other.getMotorDirection() != false) { + setMotorDirection(other.getMotorDirection()); + } + if (other.getStatus() != false) { + setStatus(other.getStatus()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int encoderId_ ; + /** + * <pre> + *0..8 + * </pre> + * + * <code>uint32 EncoderId = 1;</code> + */ + public int getEncoderId() { + return encoderId_; + } + /** + * <pre> + *0..8 + * </pre> + * + * <code>uint32 EncoderId = 1;</code> + */ + public Builder setEncoderId(int value) { + + encoderId_ = value; + onChanged(); + return this; + } + /** + * <pre> + *0..8 + * </pre> + * + * <code>uint32 EncoderId = 1;</code> + */ + public Builder clearEncoderId() { + + encoderId_ = 0; + onChanged(); + return this; + } + + private int encoderVersion_ ; + /** + * <code>uint32 EncoderVersion = 2;</code> + */ + public int getEncoderVersion() { + return encoderVersion_; + } + /** + * <code>uint32 EncoderVersion = 2;</code> + */ + public Builder setEncoderVersion(int value) { + + encoderVersion_ = value; + onChanged(); + return this; + } + /** + * <code>uint32 EncoderVersion = 2;</code> + */ + public Builder clearEncoderVersion() { + + encoderVersion_ = 0; + onChanged(); + return this; + } + + private int motorSpeed_ ; + /** + * <code>int32 MotorSpeed = 3;</code> + */ + public int getMotorSpeed() { + return motorSpeed_; + } + /** + * <code>int32 MotorSpeed = 3;</code> + */ + public Builder setMotorSpeed(int value) { + + motorSpeed_ = value; + onChanged(); + return this; + } + /** + * <code>int32 MotorSpeed = 3;</code> + */ + public Builder clearMotorSpeed() { + + motorSpeed_ = 0; + onChanged(); + return this; + } + + private boolean motorDirection_ ; + /** + * <pre> + * 1-cw 0-ccw + * </pre> + * + * <code>bool MotorDirection = 4;</code> + */ + public boolean getMotorDirection() { + return motorDirection_; + } + /** + * <pre> + * 1-cw 0-ccw + * </pre> + * + * <code>bool MotorDirection = 4;</code> + */ + public Builder setMotorDirection(boolean value) { + + motorDirection_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 1-cw 0-ccw + * </pre> + * + * <code>bool MotorDirection = 4;</code> + */ + public Builder clearMotorDirection() { + + motorDirection_ = false; + onChanged(); + return this; + } + + private boolean status_ ; + /** + * <pre> + * 0-OK 1-Failed ( motion control error > ?) + * </pre> + * + * <code>bool Status = 5;</code> + */ + public boolean getStatus() { + return status_; + } + /** + * <pre> + * 0-OK 1-Failed ( motion control error > ?) + * </pre> + * + * <code>bool Status = 5;</code> + */ + public Builder setStatus(boolean value) { + + status_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0-OK 1-Failed ( motion control error > ?) + * </pre> + * + * <code>bool Status = 5;</code> + */ + public Builder clearStatus() { + + status_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubMotorEncoderResponse) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubMotorEncoderResponse) + private static final com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse(); + } + + public static com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubMotorEncoderResponse> + PARSER = new com.google.protobuf.AbstractParser<StubMotorEncoderResponse>() { + public StubMotorEncoderResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubMotorEncoderResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubMotorEncoderResponse> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubMotorEncoderResponse> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubMotorEncoderResponseOuterClass.StubMotorEncoderResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubMotorEncoderResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubMotorEncoderResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\036StubMotorEncoderResponse.proto\022\017Tango." + + "PMR.Stubs\"\201\001\n\030StubMotorEncoderResponse\022\021" + + "\n\tEncoderId\030\001 \001(\r\022\026\n\016EncoderVersion\030\002 \001(" + + "\r\022\022\n\nMotorSpeed\030\003 \001(\005\022\026\n\016MotorDirection\030" + + "\004 \001(\010\022\016\n\006Status\030\005 \001(\010B\033\n\031com.twine.tango" + + ".pmr.stubsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubMotorEncoderResponse_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubMotorEncoderResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubMotorEncoderResponse_descriptor, + new java.lang.String[] { "EncoderId", "EncoderVersion", "MotorSpeed", "MotorDirection", "Status", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubOptLimitSwitchRequestOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubOptLimitSwitchRequestOuterClass.java new file mode 100644 index 000000000..8331c4cc6 --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubOptLimitSwitchRequestOuterClass.java @@ -0,0 +1,610 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubOptLimitSwitchRequest.proto + +package com.twine.tango.pmr.stubs; + +public final class StubOptLimitSwitchRequestOuterClass { + private StubOptLimitSwitchRequestOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubOptLimitSwitchRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubOptLimitSwitchRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * <pre> + *0..16 + * </pre> + * + * <code>uint32 LimitSwitchrId = 1;</code> + */ + int getLimitSwitchrId(); + + /** + * <pre> + * 0 - Enable 1 - Disable + * </pre> + * + * <code>bool LimitSwitchrDisable = 2;</code> + */ + boolean getLimitSwitchrDisable(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubOptLimitSwitchRequest} + */ + public static final class StubOptLimitSwitchRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubOptLimitSwitchRequest) + StubOptLimitSwitchRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubOptLimitSwitchRequest.newBuilder() to construct. + private StubOptLimitSwitchRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubOptLimitSwitchRequest() { + limitSwitchrId_ = 0; + limitSwitchrDisable_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubOptLimitSwitchRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + limitSwitchrId_ = input.readUInt32(); + break; + } + case 16: { + + limitSwitchrDisable_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.internal_static_Tango_PMR_Stubs_StubOptLimitSwitchRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.internal_static_Tango_PMR_Stubs_StubOptLimitSwitchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest.class, com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest.Builder.class); + } + + public static final int LIMITSWITCHRID_FIELD_NUMBER = 1; + private int limitSwitchrId_; + /** + * <pre> + *0..16 + * </pre> + * + * <code>uint32 LimitSwitchrId = 1;</code> + */ + public int getLimitSwitchrId() { + return limitSwitchrId_; + } + + public static final int LIMITSWITCHRDISABLE_FIELD_NUMBER = 2; + private boolean limitSwitchrDisable_; + /** + * <pre> + * 0 - Enable 1 - Disable + * </pre> + * + * <code>bool LimitSwitchrDisable = 2;</code> + */ + public boolean getLimitSwitchrDisable() { + return limitSwitchrDisable_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (limitSwitchrId_ != 0) { + output.writeUInt32(1, limitSwitchrId_); + } + if (limitSwitchrDisable_ != false) { + output.writeBool(2, limitSwitchrDisable_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (limitSwitchrId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, limitSwitchrId_); + } + if (limitSwitchrDisable_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, limitSwitchrDisable_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest other = (com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest) obj; + + boolean result = true; + result = result && (getLimitSwitchrId() + == other.getLimitSwitchrId()); + result = result && (getLimitSwitchrDisable() + == other.getLimitSwitchrDisable()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LIMITSWITCHRID_FIELD_NUMBER; + hash = (53 * hash) + getLimitSwitchrId(); + hash = (37 * hash) + LIMITSWITCHRDISABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getLimitSwitchrDisable()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubOptLimitSwitchRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubOptLimitSwitchRequest) + com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.internal_static_Tango_PMR_Stubs_StubOptLimitSwitchRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.internal_static_Tango_PMR_Stubs_StubOptLimitSwitchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest.class, com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + limitSwitchrId_ = 0; + + limitSwitchrDisable_ = false; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.internal_static_Tango_PMR_Stubs_StubOptLimitSwitchRequest_descriptor; + } + + public com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest build() { + com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest buildPartial() { + com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest result = new com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest(this); + result.limitSwitchrId_ = limitSwitchrId_; + result.limitSwitchrDisable_ = limitSwitchrDisable_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest) { + return mergeFrom((com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest other) { + if (other == com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest.getDefaultInstance()) return this; + if (other.getLimitSwitchrId() != 0) { + setLimitSwitchrId(other.getLimitSwitchrId()); + } + if (other.getLimitSwitchrDisable() != false) { + setLimitSwitchrDisable(other.getLimitSwitchrDisable()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int limitSwitchrId_ ; + /** + * <pre> + *0..16 + * </pre> + * + * <code>uint32 LimitSwitchrId = 1;</code> + */ + public int getLimitSwitchrId() { + return limitSwitchrId_; + } + /** + * <pre> + *0..16 + * </pre> + * + * <code>uint32 LimitSwitchrId = 1;</code> + */ + public Builder setLimitSwitchrId(int value) { + + limitSwitchrId_ = value; + onChanged(); + return this; + } + /** + * <pre> + *0..16 + * </pre> + * + * <code>uint32 LimitSwitchrId = 1;</code> + */ + public Builder clearLimitSwitchrId() { + + limitSwitchrId_ = 0; + onChanged(); + return this; + } + + private boolean limitSwitchrDisable_ ; + /** + * <pre> + * 0 - Enable 1 - Disable + * </pre> + * + * <code>bool LimitSwitchrDisable = 2;</code> + */ + public boolean getLimitSwitchrDisable() { + return limitSwitchrDisable_; + } + /** + * <pre> + * 0 - Enable 1 - Disable + * </pre> + * + * <code>bool LimitSwitchrDisable = 2;</code> + */ + public Builder setLimitSwitchrDisable(boolean value) { + + limitSwitchrDisable_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0 - Enable 1 - Disable + * </pre> + * + * <code>bool LimitSwitchrDisable = 2;</code> + */ + public Builder clearLimitSwitchrDisable() { + + limitSwitchrDisable_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubOptLimitSwitchRequest) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubOptLimitSwitchRequest) + private static final com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest(); + } + + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubOptLimitSwitchRequest> + PARSER = new com.google.protobuf.AbstractParser<StubOptLimitSwitchRequest>() { + public StubOptLimitSwitchRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubOptLimitSwitchRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubOptLimitSwitchRequest> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubOptLimitSwitchRequest> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubOptLimitSwitchRequestOuterClass.StubOptLimitSwitchRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubOptLimitSwitchRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubOptLimitSwitchRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\037StubOptLimitSwitchRequest.proto\022\017Tango" + + ".PMR.Stubs\"P\n\031StubOptLimitSwitchRequest\022" + + "\026\n\016LimitSwitchrId\030\001 \001(\r\022\033\n\023LimitSwitchrD" + + "isable\030\002 \001(\010B\033\n\031com.twine.tango.pmr.stub" + + "sb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubOptLimitSwitchRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubOptLimitSwitchRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubOptLimitSwitchRequest_descriptor, + new java.lang.String[] { "LimitSwitchrId", "LimitSwitchrDisable", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubOptLimitSwitchResponseOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubOptLimitSwitchResponseOuterClass.java new file mode 100644 index 000000000..a0e0f6f86 --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubOptLimitSwitchResponseOuterClass.java @@ -0,0 +1,689 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubOptLimitSwitchResponse.proto + +package com.twine.tango.pmr.stubs; + +public final class StubOptLimitSwitchResponseOuterClass { + private StubOptLimitSwitchResponseOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubOptLimitSwitchResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubOptLimitSwitchResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * <pre> + *0..19 + * </pre> + * + * <code>uint32 LimitSwitchrId = 1;</code> + */ + int getLimitSwitchrId(); + + /** + * <pre> + * </pre> + * + * <code>bool LimitSwitchDitection = 2;</code> + */ + boolean getLimitSwitchDitection(); + + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + boolean getStatus(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubOptLimitSwitchResponse} + */ + public static final class StubOptLimitSwitchResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubOptLimitSwitchResponse) + StubOptLimitSwitchResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubOptLimitSwitchResponse.newBuilder() to construct. + private StubOptLimitSwitchResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubOptLimitSwitchResponse() { + limitSwitchrId_ = 0; + limitSwitchDitection_ = false; + status_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubOptLimitSwitchResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + limitSwitchrId_ = input.readUInt32(); + break; + } + case 16: { + + limitSwitchDitection_ = input.readBool(); + break; + } + case 24: { + + status_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.internal_static_Tango_PMR_Stubs_StubOptLimitSwitchResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.internal_static_Tango_PMR_Stubs_StubOptLimitSwitchResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse.class, com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse.Builder.class); + } + + public static final int LIMITSWITCHRID_FIELD_NUMBER = 1; + private int limitSwitchrId_; + /** + * <pre> + *0..19 + * </pre> + * + * <code>uint32 LimitSwitchrId = 1;</code> + */ + public int getLimitSwitchrId() { + return limitSwitchrId_; + } + + public static final int LIMITSWITCHDITECTION_FIELD_NUMBER = 2; + private boolean limitSwitchDitection_; + /** + * <pre> + * </pre> + * + * <code>bool LimitSwitchDitection = 2;</code> + */ + public boolean getLimitSwitchDitection() { + return limitSwitchDitection_; + } + + public static final int STATUS_FIELD_NUMBER = 3; + private boolean status_; + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + public boolean getStatus() { + return status_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (limitSwitchrId_ != 0) { + output.writeUInt32(1, limitSwitchrId_); + } + if (limitSwitchDitection_ != false) { + output.writeBool(2, limitSwitchDitection_); + } + if (status_ != false) { + output.writeBool(3, status_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (limitSwitchrId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, limitSwitchrId_); + } + if (limitSwitchDitection_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, limitSwitchDitection_); + } + if (status_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, status_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse other = (com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse) obj; + + boolean result = true; + result = result && (getLimitSwitchrId() + == other.getLimitSwitchrId()); + result = result && (getLimitSwitchDitection() + == other.getLimitSwitchDitection()); + result = result && (getStatus() + == other.getStatus()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LIMITSWITCHRID_FIELD_NUMBER; + hash = (53 * hash) + getLimitSwitchrId(); + hash = (37 * hash) + LIMITSWITCHDITECTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getLimitSwitchDitection()); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getStatus()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubOptLimitSwitchResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubOptLimitSwitchResponse) + com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.internal_static_Tango_PMR_Stubs_StubOptLimitSwitchResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.internal_static_Tango_PMR_Stubs_StubOptLimitSwitchResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse.class, com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + limitSwitchrId_ = 0; + + limitSwitchDitection_ = false; + + status_ = false; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.internal_static_Tango_PMR_Stubs_StubOptLimitSwitchResponse_descriptor; + } + + public com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse build() { + com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse buildPartial() { + com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse result = new com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse(this); + result.limitSwitchrId_ = limitSwitchrId_; + result.limitSwitchDitection_ = limitSwitchDitection_; + result.status_ = status_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse) { + return mergeFrom((com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse other) { + if (other == com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse.getDefaultInstance()) return this; + if (other.getLimitSwitchrId() != 0) { + setLimitSwitchrId(other.getLimitSwitchrId()); + } + if (other.getLimitSwitchDitection() != false) { + setLimitSwitchDitection(other.getLimitSwitchDitection()); + } + if (other.getStatus() != false) { + setStatus(other.getStatus()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int limitSwitchrId_ ; + /** + * <pre> + *0..19 + * </pre> + * + * <code>uint32 LimitSwitchrId = 1;</code> + */ + public int getLimitSwitchrId() { + return limitSwitchrId_; + } + /** + * <pre> + *0..19 + * </pre> + * + * <code>uint32 LimitSwitchrId = 1;</code> + */ + public Builder setLimitSwitchrId(int value) { + + limitSwitchrId_ = value; + onChanged(); + return this; + } + /** + * <pre> + *0..19 + * </pre> + * + * <code>uint32 LimitSwitchrId = 1;</code> + */ + public Builder clearLimitSwitchrId() { + + limitSwitchrId_ = 0; + onChanged(); + return this; + } + + private boolean limitSwitchDitection_ ; + /** + * <pre> + * </pre> + * + * <code>bool LimitSwitchDitection = 2;</code> + */ + public boolean getLimitSwitchDitection() { + return limitSwitchDitection_; + } + /** + * <pre> + * </pre> + * + * <code>bool LimitSwitchDitection = 2;</code> + */ + public Builder setLimitSwitchDitection(boolean value) { + + limitSwitchDitection_ = value; + onChanged(); + return this; + } + /** + * <pre> + * </pre> + * + * <code>bool LimitSwitchDitection = 2;</code> + */ + public Builder clearLimitSwitchDitection() { + + limitSwitchDitection_ = false; + onChanged(); + return this; + } + + private boolean status_ ; + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + public boolean getStatus() { + return status_; + } + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + public Builder setStatus(boolean value) { + + status_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + public Builder clearStatus() { + + status_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubOptLimitSwitchResponse) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubOptLimitSwitchResponse) + private static final com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse(); + } + + public static com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubOptLimitSwitchResponse> + PARSER = new com.google.protobuf.AbstractParser<StubOptLimitSwitchResponse>() { + public StubOptLimitSwitchResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubOptLimitSwitchResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubOptLimitSwitchResponse> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubOptLimitSwitchResponse> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubOptLimitSwitchResponseOuterClass.StubOptLimitSwitchResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubOptLimitSwitchResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubOptLimitSwitchResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n StubOptLimitSwitchResponse.proto\022\017Tang" + + "o.PMR.Stubs\"b\n\032StubOptLimitSwitchRespons" + + "e\022\026\n\016LimitSwitchrId\030\001 \001(\r\022\034\n\024LimitSwitch" + + "Ditection\030\002 \001(\010\022\016\n\006Status\030\003 \001(\010B\033\n\031com.t" + + "wine.tango.pmr.stubsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubOptLimitSwitchResponse_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubOptLimitSwitchResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubOptLimitSwitchResponse_descriptor, + new java.lang.String[] { "LimitSwitchrId", "LimitSwitchDitection", "Status", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubSteperMotorRequestOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubSteperMotorRequestOuterClass.java new file mode 100644 index 000000000..8d41f4c3f --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubSteperMotorRequestOuterClass.java @@ -0,0 +1,861 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubSteperMotorRequest.proto + +package com.twine.tango.pmr.stubs; + +public final class StubSteperMotorRequestOuterClass { + private StubSteperMotorRequestOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubSteperMotorRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubSteperMotorRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * <pre> + *0..19 + * </pre> + * + * <code>uint32 MotorId = 1;</code> + */ + int getMotorId(); + + /** + * <pre> + * 1-start 0-stop + * </pre> + * + * <code>bool Start = 2;</code> + */ + boolean getStart(); + + /** + * <pre> + * 1-cw 0-ccw + * </pre> + * + * <code>bool SetDirection = 3;</code> + */ + boolean getSetDirection(); + + /** + * <pre> + * No. of steps for 360 deg. + * </pre> + * + * <code>int32 SetMicrostepDivision = 4;</code> + */ + int getSetMicrostepDivision(); + + /** + * <pre> + * ? + * </pre> + * + * <code>int32 SetSpeed = 5;</code> + */ + int getSetSpeed(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubSteperMotorRequest} + */ + public static final class StubSteperMotorRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubSteperMotorRequest) + StubSteperMotorRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubSteperMotorRequest.newBuilder() to construct. + private StubSteperMotorRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubSteperMotorRequest() { + motorId_ = 0; + start_ = false; + setDirection_ = false; + setMicrostepDivision_ = 0; + setSpeed_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubSteperMotorRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + motorId_ = input.readUInt32(); + break; + } + case 16: { + + start_ = input.readBool(); + break; + } + case 24: { + + setDirection_ = input.readBool(); + break; + } + case 32: { + + setMicrostepDivision_ = input.readInt32(); + break; + } + case 40: { + + setSpeed_ = input.readInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.internal_static_Tango_PMR_Stubs_StubSteperMotorRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.internal_static_Tango_PMR_Stubs_StubSteperMotorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest.class, com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest.Builder.class); + } + + public static final int MOTORID_FIELD_NUMBER = 1; + private int motorId_; + /** + * <pre> + *0..19 + * </pre> + * + * <code>uint32 MotorId = 1;</code> + */ + public int getMotorId() { + return motorId_; + } + + public static final int START_FIELD_NUMBER = 2; + private boolean start_; + /** + * <pre> + * 1-start 0-stop + * </pre> + * + * <code>bool Start = 2;</code> + */ + public boolean getStart() { + return start_; + } + + public static final int SETDIRECTION_FIELD_NUMBER = 3; + private boolean setDirection_; + /** + * <pre> + * 1-cw 0-ccw + * </pre> + * + * <code>bool SetDirection = 3;</code> + */ + public boolean getSetDirection() { + return setDirection_; + } + + public static final int SETMICROSTEPDIVISION_FIELD_NUMBER = 4; + private int setMicrostepDivision_; + /** + * <pre> + * No. of steps for 360 deg. + * </pre> + * + * <code>int32 SetMicrostepDivision = 4;</code> + */ + public int getSetMicrostepDivision() { + return setMicrostepDivision_; + } + + public static final int SETSPEED_FIELD_NUMBER = 5; + private int setSpeed_; + /** + * <pre> + * ? + * </pre> + * + * <code>int32 SetSpeed = 5;</code> + */ + public int getSetSpeed() { + return setSpeed_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (motorId_ != 0) { + output.writeUInt32(1, motorId_); + } + if (start_ != false) { + output.writeBool(2, start_); + } + if (setDirection_ != false) { + output.writeBool(3, setDirection_); + } + if (setMicrostepDivision_ != 0) { + output.writeInt32(4, setMicrostepDivision_); + } + if (setSpeed_ != 0) { + output.writeInt32(5, setSpeed_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (motorId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, motorId_); + } + if (start_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, start_); + } + if (setDirection_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, setDirection_); + } + if (setMicrostepDivision_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, setMicrostepDivision_); + } + if (setSpeed_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, setSpeed_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest other = (com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest) obj; + + boolean result = true; + result = result && (getMotorId() + == other.getMotorId()); + result = result && (getStart() + == other.getStart()); + result = result && (getSetDirection() + == other.getSetDirection()); + result = result && (getSetMicrostepDivision() + == other.getSetMicrostepDivision()); + result = result && (getSetSpeed() + == other.getSetSpeed()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MOTORID_FIELD_NUMBER; + hash = (53 * hash) + getMotorId(); + hash = (37 * hash) + START_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getStart()); + hash = (37 * hash) + SETDIRECTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getSetDirection()); + hash = (37 * hash) + SETMICROSTEPDIVISION_FIELD_NUMBER; + hash = (53 * hash) + getSetMicrostepDivision(); + hash = (37 * hash) + SETSPEED_FIELD_NUMBER; + hash = (53 * hash) + getSetSpeed(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubSteperMotorRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubSteperMotorRequest) + com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.internal_static_Tango_PMR_Stubs_StubSteperMotorRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.internal_static_Tango_PMR_Stubs_StubSteperMotorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest.class, com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + motorId_ = 0; + + start_ = false; + + setDirection_ = false; + + setMicrostepDivision_ = 0; + + setSpeed_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.internal_static_Tango_PMR_Stubs_StubSteperMotorRequest_descriptor; + } + + public com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest build() { + com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest buildPartial() { + com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest result = new com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest(this); + result.motorId_ = motorId_; + result.start_ = start_; + result.setDirection_ = setDirection_; + result.setMicrostepDivision_ = setMicrostepDivision_; + result.setSpeed_ = setSpeed_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest) { + return mergeFrom((com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest other) { + if (other == com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest.getDefaultInstance()) return this; + if (other.getMotorId() != 0) { + setMotorId(other.getMotorId()); + } + if (other.getStart() != false) { + setStart(other.getStart()); + } + if (other.getSetDirection() != false) { + setSetDirection(other.getSetDirection()); + } + if (other.getSetMicrostepDivision() != 0) { + setSetMicrostepDivision(other.getSetMicrostepDivision()); + } + if (other.getSetSpeed() != 0) { + setSetSpeed(other.getSetSpeed()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int motorId_ ; + /** + * <pre> + *0..19 + * </pre> + * + * <code>uint32 MotorId = 1;</code> + */ + public int getMotorId() { + return motorId_; + } + /** + * <pre> + *0..19 + * </pre> + * + * <code>uint32 MotorId = 1;</code> + */ + public Builder setMotorId(int value) { + + motorId_ = value; + onChanged(); + return this; + } + /** + * <pre> + *0..19 + * </pre> + * + * <code>uint32 MotorId = 1;</code> + */ + public Builder clearMotorId() { + + motorId_ = 0; + onChanged(); + return this; + } + + private boolean start_ ; + /** + * <pre> + * 1-start 0-stop + * </pre> + * + * <code>bool Start = 2;</code> + */ + public boolean getStart() { + return start_; + } + /** + * <pre> + * 1-start 0-stop + * </pre> + * + * <code>bool Start = 2;</code> + */ + public Builder setStart(boolean value) { + + start_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 1-start 0-stop + * </pre> + * + * <code>bool Start = 2;</code> + */ + public Builder clearStart() { + + start_ = false; + onChanged(); + return this; + } + + private boolean setDirection_ ; + /** + * <pre> + * 1-cw 0-ccw + * </pre> + * + * <code>bool SetDirection = 3;</code> + */ + public boolean getSetDirection() { + return setDirection_; + } + /** + * <pre> + * 1-cw 0-ccw + * </pre> + * + * <code>bool SetDirection = 3;</code> + */ + public Builder setSetDirection(boolean value) { + + setDirection_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 1-cw 0-ccw + * </pre> + * + * <code>bool SetDirection = 3;</code> + */ + public Builder clearSetDirection() { + + setDirection_ = false; + onChanged(); + return this; + } + + private int setMicrostepDivision_ ; + /** + * <pre> + * No. of steps for 360 deg. + * </pre> + * + * <code>int32 SetMicrostepDivision = 4;</code> + */ + public int getSetMicrostepDivision() { + return setMicrostepDivision_; + } + /** + * <pre> + * No. of steps for 360 deg. + * </pre> + * + * <code>int32 SetMicrostepDivision = 4;</code> + */ + public Builder setSetMicrostepDivision(int value) { + + setMicrostepDivision_ = value; + onChanged(); + return this; + } + /** + * <pre> + * No. of steps for 360 deg. + * </pre> + * + * <code>int32 SetMicrostepDivision = 4;</code> + */ + public Builder clearSetMicrostepDivision() { + + setMicrostepDivision_ = 0; + onChanged(); + return this; + } + + private int setSpeed_ ; + /** + * <pre> + * ? + * </pre> + * + * <code>int32 SetSpeed = 5;</code> + */ + public int getSetSpeed() { + return setSpeed_; + } + /** + * <pre> + * ? + * </pre> + * + * <code>int32 SetSpeed = 5;</code> + */ + public Builder setSetSpeed(int value) { + + setSpeed_ = value; + onChanged(); + return this; + } + /** + * <pre> + * ? + * </pre> + * + * <code>int32 SetSpeed = 5;</code> + */ + public Builder clearSetSpeed() { + + setSpeed_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubSteperMotorRequest) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubSteperMotorRequest) + private static final com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest(); + } + + public static com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubSteperMotorRequest> + PARSER = new com.google.protobuf.AbstractParser<StubSteperMotorRequest>() { + public StubSteperMotorRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubSteperMotorRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubSteperMotorRequest> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubSteperMotorRequest> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubSteperMotorRequestOuterClass.StubSteperMotorRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubSteperMotorRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubSteperMotorRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\034StubSteperMotorRequest.proto\022\017Tango.PM" + + "R.Stubs\"~\n\026StubSteperMotorRequest\022\017\n\007Mot" + + "orId\030\001 \001(\r\022\r\n\005Start\030\002 \001(\010\022\024\n\014SetDirectio" + + "n\030\003 \001(\010\022\034\n\024SetMicrostepDivision\030\004 \001(\005\022\020\n" + + "\010SetSpeed\030\005 \001(\005B\033\n\031com.twine.tango.pmr.s" + + "tubsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubSteperMotorRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubSteperMotorRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubSteperMotorRequest_descriptor, + new java.lang.String[] { "MotorId", "Start", "SetDirection", "SetMicrostepDivision", "SetSpeed", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubSteperMotorResponseOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubSteperMotorResponseOuterClass.java new file mode 100644 index 000000000..5c65563ec --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubSteperMotorResponseOuterClass.java @@ -0,0 +1,688 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubSteperMotorResponse.proto + +package com.twine.tango.pmr.stubs; + +public final class StubSteperMotorResponseOuterClass { + private StubSteperMotorResponseOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubSteperMotorResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubSteperMotorResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * <pre> + *0..19 + * </pre> + * + * <code>uint32 MotorId = 1;</code> + */ + int getMotorId(); + + /** + * <pre> + * </pre> + * + * <code>uint32 MotorVersion = 2;</code> + */ + int getMotorVersion(); + + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + boolean getStatus(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubSteperMotorResponse} + */ + public static final class StubSteperMotorResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubSteperMotorResponse) + StubSteperMotorResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubSteperMotorResponse.newBuilder() to construct. + private StubSteperMotorResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubSteperMotorResponse() { + motorId_ = 0; + motorVersion_ = 0; + status_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubSteperMotorResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + motorId_ = input.readUInt32(); + break; + } + case 16: { + + motorVersion_ = input.readUInt32(); + break; + } + case 24: { + + status_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.internal_static_Tango_PMR_Stubs_StubSteperMotorResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.internal_static_Tango_PMR_Stubs_StubSteperMotorResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse.class, com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse.Builder.class); + } + + public static final int MOTORID_FIELD_NUMBER = 1; + private int motorId_; + /** + * <pre> + *0..19 + * </pre> + * + * <code>uint32 MotorId = 1;</code> + */ + public int getMotorId() { + return motorId_; + } + + public static final int MOTORVERSION_FIELD_NUMBER = 2; + private int motorVersion_; + /** + * <pre> + * </pre> + * + * <code>uint32 MotorVersion = 2;</code> + */ + public int getMotorVersion() { + return motorVersion_; + } + + public static final int STATUS_FIELD_NUMBER = 3; + private boolean status_; + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + public boolean getStatus() { + return status_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (motorId_ != 0) { + output.writeUInt32(1, motorId_); + } + if (motorVersion_ != 0) { + output.writeUInt32(2, motorVersion_); + } + if (status_ != false) { + output.writeBool(3, status_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (motorId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, motorId_); + } + if (motorVersion_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, motorVersion_); + } + if (status_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, status_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse other = (com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse) obj; + + boolean result = true; + result = result && (getMotorId() + == other.getMotorId()); + result = result && (getMotorVersion() + == other.getMotorVersion()); + result = result && (getStatus() + == other.getStatus()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MOTORID_FIELD_NUMBER; + hash = (53 * hash) + getMotorId(); + hash = (37 * hash) + MOTORVERSION_FIELD_NUMBER; + hash = (53 * hash) + getMotorVersion(); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getStatus()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubSteperMotorResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubSteperMotorResponse) + com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.internal_static_Tango_PMR_Stubs_StubSteperMotorResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.internal_static_Tango_PMR_Stubs_StubSteperMotorResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse.class, com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + motorId_ = 0; + + motorVersion_ = 0; + + status_ = false; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.internal_static_Tango_PMR_Stubs_StubSteperMotorResponse_descriptor; + } + + public com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse build() { + com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse buildPartial() { + com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse result = new com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse(this); + result.motorId_ = motorId_; + result.motorVersion_ = motorVersion_; + result.status_ = status_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse) { + return mergeFrom((com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse other) { + if (other == com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse.getDefaultInstance()) return this; + if (other.getMotorId() != 0) { + setMotorId(other.getMotorId()); + } + if (other.getMotorVersion() != 0) { + setMotorVersion(other.getMotorVersion()); + } + if (other.getStatus() != false) { + setStatus(other.getStatus()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int motorId_ ; + /** + * <pre> + *0..19 + * </pre> + * + * <code>uint32 MotorId = 1;</code> + */ + public int getMotorId() { + return motorId_; + } + /** + * <pre> + *0..19 + * </pre> + * + * <code>uint32 MotorId = 1;</code> + */ + public Builder setMotorId(int value) { + + motorId_ = value; + onChanged(); + return this; + } + /** + * <pre> + *0..19 + * </pre> + * + * <code>uint32 MotorId = 1;</code> + */ + public Builder clearMotorId() { + + motorId_ = 0; + onChanged(); + return this; + } + + private int motorVersion_ ; + /** + * <pre> + * </pre> + * + * <code>uint32 MotorVersion = 2;</code> + */ + public int getMotorVersion() { + return motorVersion_; + } + /** + * <pre> + * </pre> + * + * <code>uint32 MotorVersion = 2;</code> + */ + public Builder setMotorVersion(int value) { + + motorVersion_ = value; + onChanged(); + return this; + } + /** + * <pre> + * </pre> + * + * <code>uint32 MotorVersion = 2;</code> + */ + public Builder clearMotorVersion() { + + motorVersion_ = 0; + onChanged(); + return this; + } + + private boolean status_ ; + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + public boolean getStatus() { + return status_; + } + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + public Builder setStatus(boolean value) { + + status_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + public Builder clearStatus() { + + status_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubSteperMotorResponse) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubSteperMotorResponse) + private static final com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse(); + } + + public static com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubSteperMotorResponse> + PARSER = new com.google.protobuf.AbstractParser<StubSteperMotorResponse>() { + public StubSteperMotorResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubSteperMotorResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubSteperMotorResponse> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubSteperMotorResponse> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubSteperMotorResponseOuterClass.StubSteperMotorResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubSteperMotorResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubSteperMotorResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\035StubSteperMotorResponse.proto\022\017Tango.P" + + "MR.Stubs\"P\n\027StubSteperMotorResponse\022\017\n\007M" + + "otorId\030\001 \001(\r\022\024\n\014MotorVersion\030\002 \001(\r\022\016\n\006St" + + "atus\030\003 \001(\010B\033\n\031com.twine.tango.pmr.stubsb" + + "\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubSteperMotorResponse_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubSteperMotorResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubSteperMotorResponse_descriptor, + new java.lang.String[] { "MotorId", "MotorVersion", "Status", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubValveRequestOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubValveRequestOuterClass.java new file mode 100644 index 000000000..70556b17a --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubValveRequestOuterClass.java @@ -0,0 +1,631 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubValveRequest.proto + +package com.twine.tango.pmr.stubs; + +public final class StubValveRequestOuterClass { + private StubValveRequestOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubValveRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubValveRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>int32 ValveId = 1;</code> + */ + int getValveId(); + + /** + * <code>int32 Inkflow = 2;</code> + */ + int getInkflow(); + + /** + * <code>int32 ValveOn = 3;</code> + */ + int getValveOn(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubValveRequest} + */ + public static final class StubValveRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubValveRequest) + StubValveRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubValveRequest.newBuilder() to construct. + private StubValveRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubValveRequest() { + valveId_ = 0; + inkflow_ = 0; + valveOn_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubValveRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + valveId_ = input.readInt32(); + break; + } + case 16: { + + inkflow_ = input.readInt32(); + break; + } + case 24: { + + valveOn_ = input.readInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubValveRequestOuterClass.internal_static_Tango_PMR_Stubs_StubValveRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubValveRequestOuterClass.internal_static_Tango_PMR_Stubs_StubValveRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest.class, com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest.Builder.class); + } + + public static final int VALVEID_FIELD_NUMBER = 1; + private int valveId_; + /** + * <code>int32 ValveId = 1;</code> + */ + public int getValveId() { + return valveId_; + } + + public static final int INKFLOW_FIELD_NUMBER = 2; + private int inkflow_; + /** + * <code>int32 Inkflow = 2;</code> + */ + public int getInkflow() { + return inkflow_; + } + + public static final int VALVEON_FIELD_NUMBER = 3; + private int valveOn_; + /** + * <code>int32 ValveOn = 3;</code> + */ + public int getValveOn() { + return valveOn_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (valveId_ != 0) { + output.writeInt32(1, valveId_); + } + if (inkflow_ != 0) { + output.writeInt32(2, inkflow_); + } + if (valveOn_ != 0) { + output.writeInt32(3, valveOn_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (valveId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, valveId_); + } + if (inkflow_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, inkflow_); + } + if (valveOn_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, valveOn_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest other = (com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest) obj; + + boolean result = true; + result = result && (getValveId() + == other.getValveId()); + result = result && (getInkflow() + == other.getInkflow()); + result = result && (getValveOn() + == other.getValveOn()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VALVEID_FIELD_NUMBER; + hash = (53 * hash) + getValveId(); + hash = (37 * hash) + INKFLOW_FIELD_NUMBER; + hash = (53 * hash) + getInkflow(); + hash = (37 * hash) + VALVEON_FIELD_NUMBER; + hash = (53 * hash) + getValveOn(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubValveRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubValveRequest) + com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubValveRequestOuterClass.internal_static_Tango_PMR_Stubs_StubValveRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubValveRequestOuterClass.internal_static_Tango_PMR_Stubs_StubValveRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest.class, com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + valveId_ = 0; + + inkflow_ = 0; + + valveOn_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubValveRequestOuterClass.internal_static_Tango_PMR_Stubs_StubValveRequest_descriptor; + } + + public com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest build() { + com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest buildPartial() { + com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest result = new com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest(this); + result.valveId_ = valveId_; + result.inkflow_ = inkflow_; + result.valveOn_ = valveOn_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest) { + return mergeFrom((com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest other) { + if (other == com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest.getDefaultInstance()) return this; + if (other.getValveId() != 0) { + setValveId(other.getValveId()); + } + if (other.getInkflow() != 0) { + setInkflow(other.getInkflow()); + } + if (other.getValveOn() != 0) { + setValveOn(other.getValveOn()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int valveId_ ; + /** + * <code>int32 ValveId = 1;</code> + */ + public int getValveId() { + return valveId_; + } + /** + * <code>int32 ValveId = 1;</code> + */ + public Builder setValveId(int value) { + + valveId_ = value; + onChanged(); + return this; + } + /** + * <code>int32 ValveId = 1;</code> + */ + public Builder clearValveId() { + + valveId_ = 0; + onChanged(); + return this; + } + + private int inkflow_ ; + /** + * <code>int32 Inkflow = 2;</code> + */ + public int getInkflow() { + return inkflow_; + } + /** + * <code>int32 Inkflow = 2;</code> + */ + public Builder setInkflow(int value) { + + inkflow_ = value; + onChanged(); + return this; + } + /** + * <code>int32 Inkflow = 2;</code> + */ + public Builder clearInkflow() { + + inkflow_ = 0; + onChanged(); + return this; + } + + private int valveOn_ ; + /** + * <code>int32 ValveOn = 3;</code> + */ + public int getValveOn() { + return valveOn_; + } + /** + * <code>int32 ValveOn = 3;</code> + */ + public Builder setValveOn(int value) { + + valveOn_ = value; + onChanged(); + return this; + } + /** + * <code>int32 ValveOn = 3;</code> + */ + public Builder clearValveOn() { + + valveOn_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubValveRequest) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubValveRequest) + private static final com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest(); + } + + public static com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubValveRequest> + PARSER = new com.google.protobuf.AbstractParser<StubValveRequest>() { + public StubValveRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubValveRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubValveRequest> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubValveRequest> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubValveRequestOuterClass.StubValveRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubValveRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubValveRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\026StubValveRequest.proto\022\017Tango.PMR.Stub" + + "s\"E\n\020StubValveRequest\022\017\n\007ValveId\030\001 \001(\005\022\017" + + "\n\007Inkflow\030\002 \001(\005\022\017\n\007ValveOn\030\003 \001(\005B\033\n\031com." + + "twine.tango.pmr.stubsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubValveRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubValveRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubValveRequest_descriptor, + new java.lang.String[] { "ValveId", "Inkflow", "ValveOn", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubValveResponseOuterClass.java b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubValveResponseOuterClass.java new file mode 100644 index 000000000..e963dff05 --- /dev/null +++ b/Software/Android_Studio/Tango.PMR/src/main/java/com/twine/tango/pmr/stubs/StubValveResponseOuterClass.java @@ -0,0 +1,525 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StubValveResponse.proto + +package com.twine.tango.pmr.stubs; + +public final class StubValveResponseOuterClass { + private StubValveResponseOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface StubValveResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Stubs.StubValveResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + boolean getStatus(); + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubValveResponse} + */ + public static final class StubValveResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Stubs.StubValveResponse) + StubValveResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use StubValveResponse.newBuilder() to construct. + private StubValveResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private StubValveResponse() { + status_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StubValveResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 24: { + + status_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubValveResponseOuterClass.internal_static_Tango_PMR_Stubs_StubValveResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubValveResponseOuterClass.internal_static_Tango_PMR_Stubs_StubValveResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse.class, com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse.Builder.class); + } + + public static final int STATUS_FIELD_NUMBER = 3; + private boolean status_; + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + public boolean getStatus() { + return status_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (status_ != false) { + output.writeBool(3, status_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (status_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, status_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse)) { + return super.equals(obj); + } + com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse other = (com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse) obj; + + boolean result = true; + result = result && (getStatus() + == other.getStatus()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getStatus()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Stubs.StubValveResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Stubs.StubValveResponse) + com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.stubs.StubValveResponseOuterClass.internal_static_Tango_PMR_Stubs_StubValveResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.stubs.StubValveResponseOuterClass.internal_static_Tango_PMR_Stubs_StubValveResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse.class, com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse.Builder.class); + } + + // Construct using com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + status_ = false; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.stubs.StubValveResponseOuterClass.internal_static_Tango_PMR_Stubs_StubValveResponse_descriptor; + } + + public com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse getDefaultInstanceForType() { + return com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse.getDefaultInstance(); + } + + public com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse build() { + com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse buildPartial() { + com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse result = new com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse(this); + result.status_ = status_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse) { + return mergeFrom((com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse other) { + if (other == com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse.getDefaultInstance()) return this; + if (other.getStatus() != false) { + setStatus(other.getStatus()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean status_ ; + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + public boolean getStatus() { + return status_; + } + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + public Builder setStatus(boolean value) { + + status_ = value; + onChanged(); + return this; + } + /** + * <pre> + * 0-OK 1-Failed + * </pre> + * + * <code>bool Status = 3;</code> + */ + public Builder clearStatus() { + + status_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Stubs.StubValveResponse) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Stubs.StubValveResponse) + private static final com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse(); + } + + public static com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<StubValveResponse> + PARSER = new com.google.protobuf.AbstractParser<StubValveResponse>() { + public StubValveResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StubValveResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<StubValveResponse> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<StubValveResponse> getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.stubs.StubValveResponseOuterClass.StubValveResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Stubs_StubValveResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Stubs_StubValveResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\027StubValveResponse.proto\022\017Tango.PMR.Stu" + + "bs\"#\n\021StubValveResponse\022\016\n\006Status\030\003 \001(\010B" + + "\033\n\031com.twine.tango.pmr.stubsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Stubs_StubValveResponse_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Stubs_StubValveResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Stubs_StubValveResponse_descriptor, + new java.lang.String[] { "Status", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/Synchronization_TST.java b/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/Synchronization_TST.java index 92e745a10..b162c2215 100644 --- a/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/Synchronization_TST.java +++ b/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/Synchronization_TST.java @@ -5,7 +5,8 @@ import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import com.elvishew.xlog.XLog; -import com.twine.tango.dal.dao.OrganizationsDAO; +import com.twine.tango.dal.TangoDB; +import com.twine.tango.dal.dao.TangoDAO; import com.twine.tango.dal.entities.Organization; import com.twine.tango.integration.MachineIdentityProvider; import com.twine.tango.synchronization.ITangoSynchronizer; @@ -32,7 +33,7 @@ public class Synchronization_TST // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); - for (Organization org : OrganizationsDAO.getAllOrganizations()) + for (Organization org : TangoDAO.getAllOrganizations()) { XLog.i(org.getName()); } @@ -41,7 +42,7 @@ public class Synchronization_TST synchronizer.synchronizeDB().subscribe(() -> { - for (Organization org : OrganizationsDAO.getAllOrganizations()) + for (Organization org : TangoDAO.getAllOrganizations()) { XLog.i(org.getName()); } diff --git a/Software/DB/Tango.db-journal b/Software/DB/Tango.db-journal Binary files differnew file mode 100644 index 000000000..1b843ca54 --- /dev/null +++ b/Software/DB/Tango.db-journal diff --git a/Software/Graphics/account.png b/Software/Graphics/account.png Binary files differnew file mode 100644 index 000000000..46f0d38fc --- /dev/null +++ b/Software/Graphics/account.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/DBModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/DBModule.cs index b1a268a9b..0928d2a1f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/DBModule.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/DBModule.cs @@ -25,7 +25,7 @@ namespace Tango.MachineStudio.DB public bool IsInitialized => _isInitialized; - public PermissionsEnum Permission => PermissionsEnum.RunDataBaseModule; + public Permissions Permission => Permissions.RunDataBaseModule; public void Dispose() { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ExtensionMethods/INotificationProviderExtensions.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ExtensionMethods/INotificationProviderExtensions.cs index 2da59724c..8d95bb38e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ExtensionMethods/INotificationProviderExtensions.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ExtensionMethods/INotificationProviderExtensions.cs @@ -9,6 +9,7 @@ using Tango.DAL.Observables; using Tango.MachineStudio.Common.Notifications; using Tango.MachineStudio.DB.ViewModels; using Tango.MachineStudio.DB.Views.DBViews; +using Tango.MachineStudio.DB.Windows; namespace Tango.MachineStudio.DB.ExtensionMethods { @@ -17,11 +18,13 @@ namespace Tango.MachineStudio.DB.ExtensionMethods public static bool ShowDialog<T>(this INotificationProvider provider, DialogOpenMode mode, DbTableViewModel<T> context) where T : class, IObservableEntity { Type viewType = typeof(INotificationProviderExtensions).Assembly.GetType(typeof(OrganizationView).Namespace + "." + typeof(T).Name + "View"); - return provider.ShowDialog( - (mode == DialogOpenMode.Editing ? PackIconKind.TableEdit : PackIconKind.Plus), - (mode == DialogOpenMode.Editing ? "Edit " : "Add New ") + typeof(T).Name, - Activator.CreateInstance(viewType) as FrameworkElement, - context); + + DBDialogWindow window = new DBDialogWindow(Activator.CreateInstance(viewType) as FrameworkElement); + window.IconKind = (mode == DialogOpenMode.Editing ? PackIconKind.TableEdit : PackIconKind.Plus); + window.InnerTitle = (mode == DialogOpenMode.Editing ? "Edit " : "Add New ") + typeof(T).Name; + window.DataContext = context; + + return provider.ShowModalWindow(window).Value; } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Managers/ViewsManager.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Managers/ViewsManager.cs index ba68fa358..2bb5969bc 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Managers/ViewsManager.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Managers/ViewsManager.cs @@ -22,9 +22,9 @@ namespace Tango.MachineStudio.DB.Managers DisplayedViews = new ObservableCollection<RegisteredView>(); DbViews = new ObservableCollection<RegisteredView>(); - foreach (var type in typeof(ViewsManager).Assembly.GetTypes().Where(x => x.CustomAttributes.Count() > 0 && x.CustomAttributes.First().AttributeType == typeof(DBViewAttribute))) + foreach (var type in typeof(ViewsManager).Assembly.GetTypes().Where(x => x.CustomAttributes.Count() > 0 && x.CustomAttributes.First().AttributeType == typeof(DBViewAttribute)).OrderBy(x => x.Name)) { - DbViews.Add(new RegisteredView(type.Name.Replace("View", ""), Activator.CreateInstance(type) as FrameworkElement)); + DbViews.Add(new RegisteredView(type.Name.Replace("View", "").ToTitle(), Activator.CreateInstance(type) as FrameworkElement)); } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Messages/CloseEntityEditViewMessage.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Messages/CloseEntityEditViewMessage.cs new file mode 100644 index 000000000..97e5cf21c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Messages/CloseEntityEditViewMessage.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.MachineStudio.Common.Messages; + +namespace Tango.MachineStudio.DB.Messages +{ + public class CloseEntityEditViewMessage : IStudioMessage + { + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Messages/OpenEntityEditViewMessage.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Messages/OpenEntityEditViewMessage.cs new file mode 100644 index 000000000..b3bf53f93 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Messages/OpenEntityEditViewMessage.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Messages; +using Tango.MachineStudio.DB.ViewModels; +using Tango.SharedUI; + +namespace Tango.MachineStudio.DB.Messages +{ + public class OpenEntityEditViewMessage : IStudioMessage + { + public DialogOpenMode DialogOpenMode { get; set; } + + public ViewModel Context { get; set; } + + public Type EntityType { get; set; } + + public OpenEntityEditViewMessage(DialogOpenMode mode, ViewModel context, Type entityType) + { + DialogOpenMode = mode; + Context = context; + EntityType = entityType; + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj index 712a99953..bb52ecb86 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj @@ -61,6 +61,9 @@ <Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <HintPath>..\..\..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath> </Reference> + <Reference Include="SimpleValidator, Version=0.6.1.0, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\SimpleValidator.0.6.1.0\lib\net40\SimpleValidator.dll</HintPath> + </Reference> <Reference Include="System" /> <Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.Data" /> @@ -79,15 +82,35 @@ <Reference Include="WindowsBase" /> <Reference Include="PresentationCore" /> <Reference Include="PresentationFramework" /> + <Reference Include="WriteableBitmapEx.Wpf, Version=1.5.0.0, Culture=neutral, PublicKeyToken=50375ca6144f1c69, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\WriteableBitmapEx.1.5.0.0\lib\net40\WriteableBitmapEx.Wpf.dll</HintPath> + </Reference> </ItemGroup> <ItemGroup> <Compile Include="Converters\RolesPermissionsToStringConverter.cs" /> <Compile Include="DBModule.cs" /> <Compile Include="ExtensionMethods\INotificationProviderExtensions.cs" /> + <Compile Include="Messages\CloseEntityEditViewMessage.cs" /> + <Compile Include="Messages\OpenEntityEditViewMessage.cs" /> <Compile Include="ViewModels\AddressesViewVM.cs" /> + <Compile Include="ViewModels\ApplicationDisplayPanelVersionsViewVM.cs" /> + <Compile Include="ViewModels\ApplicationFirmwareVersionsViewVM.cs" /> + <Compile Include="ViewModels\ApplicationOsVersionsViewVM.cs" /> + <Compile Include="ViewModels\ApplicationVersionsViewVM.cs" /> + <Compile Include="ViewModels\CartridgesViewVM.cs" /> + <Compile Include="ViewModels\CartridgeTypesViewVM.cs" /> + <Compile Include="ViewModels\ConfigurationsViewVM.cs" /> <Compile Include="ViewModels\DbTableViewModel.cs" /> <Compile Include="ViewModels\DialogOpenMode.cs" /> + <Compile Include="ViewModels\DispenserTypesViewVM.cs" /> + <Compile Include="ViewModels\DispensersViewVM.cs" /> + <Compile Include="ViewModels\EmbeddedFirmwareVersionsViewVM.cs" /> + <Compile Include="ViewModels\EmbeddedSoftwareVersionsViewVM.cs" /> + <Compile Include="ViewModels\HardwareVersionsViewVM.cs" /> + <Compile Include="ViewModels\IdsPacksViewVM.cs" /> + <Compile Include="ViewModels\LiquidsViewVM.cs" /> <Compile Include="ViewModels\MachinesViewVM.cs" /> + <Compile Include="ViewModels\MachineVersionsViewVM.cs" /> <Compile Include="ViewModels\MultiComboVM.cs" /> <Compile Include="ViewModels\OrganizationsViewVM.cs" /> <Compile Include="ViewModels\PermissionsViewVM.cs" /> @@ -96,6 +119,96 @@ <Compile Include="ViewModels\EntityViewModel.cs" /> <Compile Include="ViewModels\MainViewVM.cs" /> <Compile Include="ViewModelLocator.cs" /> + <Compile Include="Views\DBViews\IdsPacksView.xaml.cs"> + <DependentUpon>IdsPacksView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\CartridgeTypesView.xaml.cs"> + <DependentUpon>CartridgeTypesView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\CartridgesView.xaml.cs"> + <DependentUpon>CartridgesView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\DispensersView.xaml.cs"> + <DependentUpon>DispensersView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\DispenserTypesView.xaml.cs"> + <DependentUpon>DispenserTypesView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\CartridgeTypeView.xaml.cs"> + <DependentUpon>CartridgeTypeView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\CartridgeView.xaml.cs"> + <DependentUpon>CartridgeView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\DispenserView.xaml.cs"> + <DependentUpon>DispenserView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\DispenserTypeView.xaml.cs"> + <DependentUpon>DispenserTypeView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\IdsPackView.xaml.cs"> + <DependentUpon>IdsPackView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\LiquidView.xaml.cs"> + <DependentUpon>LiquidView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\LiquidsView.xaml.cs"> + <DependentUpon>LiquidsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\HardwareVersionView.xaml.cs"> + <DependentUpon>HardwareVersionView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\EmbeddedSoftwareVersionView.xaml.cs"> + <DependentUpon>EmbeddedSoftwareVersionView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\EmbeddedFirmwareVersionView.xaml.cs"> + <DependentUpon>EmbeddedFirmwareVersionView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ApplicationVersionView.xaml.cs"> + <DependentUpon>ApplicationVersionView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ApplicationOsVersionView.xaml.cs"> + <DependentUpon>ApplicationOsVersionView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ApplicationFirmwareVersionView.xaml.cs"> + <DependentUpon>ApplicationFirmwareVersionView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\HardwareVersionsView.xaml.cs"> + <DependentUpon>HardwareVersionsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\EmbeddedSoftwareVersionsView.xaml.cs"> + <DependentUpon>EmbeddedSoftwareVersionsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\EmbeddedFirmwareVersionsView.xaml.cs"> + <DependentUpon>EmbeddedFirmwareVersionsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ApplicationVersionsView.xaml.cs"> + <DependentUpon>ApplicationVersionsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ApplicationOsVersionsView.xaml.cs"> + <DependentUpon>ApplicationOsVersionsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ApplicationFirmwareVersionsView.xaml.cs"> + <DependentUpon>ApplicationFirmwareVersionsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ConfigurationsView.xaml.cs"> + <DependentUpon>ConfigurationsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ApplicationDisplayPanelVersionsView.xaml.cs"> + <DependentUpon>ApplicationDisplayPanelVersionsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\MachineVersionsView.xaml.cs"> + <DependentUpon>MachineVersionsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ApplicationDisplayPanelVersionView.xaml.cs"> + <DependentUpon>ApplicationDisplayPanelVersionView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\MachineVersionView.xaml.cs"> + <DependentUpon>MachineVersionView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ConfigurationView.xaml.cs"> + <DependentUpon>ConfigurationView.xaml</DependentUpon> + </Compile> <Compile Include="Views\DBViews\PermissionView.xaml.cs"> <DependentUpon>PermissionView.xaml</DependentUpon> </Compile> @@ -135,6 +248,9 @@ <Compile Include="Views\MainDBView.xaml.cs"> <DependentUpon>MainDBView.xaml</DependentUpon> </Compile> + <Compile Include="Windows\DBDialogWindow.xaml.cs"> + <DependentUpon>DBDialogWindow.xaml</DependentUpon> + </Compile> <Page Include="Controls\DbTableView.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> @@ -150,6 +266,126 @@ <Compile Include="CustomAttributes\DBViewAttribute.cs" /> <Compile Include="Managers\RegisteredView.cs" /> <Compile Include="Managers\ViewsManager.cs" /> + <Page Include="Views\DBViews\IdsPacksView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\CartridgeTypesView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\CartridgesView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\DispensersView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\DispenserTypesView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\CartridgeTypeView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\CartridgeView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\DispenserView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\DispenserTypeView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\IdsPackView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\LiquidView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\LiquidsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\HardwareVersionView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\EmbeddedSoftwareVersionView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\EmbeddedFirmwareVersionView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ApplicationVersionView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ApplicationOsVersionView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ApplicationFirmwareVersionView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\HardwareVersionsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\EmbeddedSoftwareVersionsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\EmbeddedFirmwareVersionsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ApplicationVersionsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ApplicationOsVersionsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ApplicationFirmwareVersionsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ConfigurationsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ApplicationDisplayPanelVersionsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\MachineVersionsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ApplicationDisplayPanelVersionView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\MachineVersionView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ConfigurationView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> <Page Include="Views\DBViews\PermissionView.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> @@ -202,6 +438,10 @@ <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </Page> + <Page Include="Windows\DBDialogWindow.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> </ItemGroup> <ItemGroup> <Compile Include="Properties\AssemblyInfo.cs"> @@ -229,6 +469,10 @@ </None> </ItemGroup> <ItemGroup> + <ProjectReference Include="..\..\..\Tango.ColorPicker\Tango.ColorPicker.csproj"> + <Project>{a2f5af44-29ff-45d6-9d25-ecda5cce88b5}</Project> + <Name>Tango.ColorPicker</Name> + </ProjectReference> <ProjectReference Include="..\..\..\Tango.Core\Tango.Core.csproj"> <Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project> <Name>Tango.Core</Name> @@ -259,5 +503,6 @@ <ItemGroup> <Resource Include="Images\seamless-grid.jpg" /> </ItemGroup> + <ItemGroup /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs index c5f3f452e..48175ed17 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs @@ -24,6 +24,23 @@ namespace Tango.MachineStudio.DB SimpleIoc.Default.Register<UsersViewVM>(); SimpleIoc.Default.Register<RolesViewVM>(); SimpleIoc.Default.Register<PermissionsViewVM>(); + SimpleIoc.Default.Register<MachineVersionsViewVM>(); + SimpleIoc.Default.Register<ConfigurationsViewVM>(); + + SimpleIoc.Default.Register<ApplicationDisplayPanelVersionsViewVM>(); + SimpleIoc.Default.Register<ApplicationFirmwareVersionsViewVM>(); + SimpleIoc.Default.Register<ApplicationOsVersionsViewVM>(); + SimpleIoc.Default.Register<ApplicationVersionsViewVM>(); + SimpleIoc.Default.Register<EmbeddedFirmwareVersionsViewVM>(); + SimpleIoc.Default.Register<EmbeddedSoftwareVersionsViewVM>(); + SimpleIoc.Default.Register<HardwareVersionsViewVM>(); + + SimpleIoc.Default.Register<IdsPacksViewVM>(); + SimpleIoc.Default.Register<DispensersViewVM>(); + SimpleIoc.Default.Register<DispenserTypesViewVM>(); + SimpleIoc.Default.Register<LiquidsViewVM>(); + SimpleIoc.Default.Register<CartridgesViewVM>(); + SimpleIoc.Default.Register<CartridgeTypesViewVM>(); } public static MainViewVM MainViewVM @@ -81,5 +98,125 @@ namespace Tango.MachineStudio.DB return ServiceLocator.Current.GetInstance<PermissionsViewVM>(); } } + + public static MachineVersionsViewVM MachineVersionsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<MachineVersionsViewVM>(); + } + } + + public static ConfigurationsViewVM ConfigurationsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<ConfigurationsViewVM>(); + } + } + + public static ApplicationDisplayPanelVersionsViewVM ApplicationDisplayPanelVersionsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<ApplicationDisplayPanelVersionsViewVM>(); + } + } + + public static ApplicationFirmwareVersionsViewVM ApplicationFirmwareVersionsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<ApplicationFirmwareVersionsViewVM>(); + } + } + + public static ApplicationOsVersionsViewVM ApplicationOsVersionsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<ApplicationOsVersionsViewVM>(); + } + } + + public static ApplicationVersionsViewVM ApplicationVersionsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<ApplicationVersionsViewVM>(); + } + } + + public static EmbeddedFirmwareVersionsViewVM EmbeddedFirmwareVersionsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<EmbeddedFirmwareVersionsViewVM>(); + } + } + + public static EmbeddedSoftwareVersionsViewVM EmbeddedSoftwareVersionsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<EmbeddedSoftwareVersionsViewVM>(); + } + } + + public static HardwareVersionsViewVM HardwareVersionsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<HardwareVersionsViewVM>(); + } + } + + public static IdsPacksViewVM IdsPacksViewVM + { + get + { + return ServiceLocator.Current.GetInstance<IdsPacksViewVM>(); + } + } + + public static DispensersViewVM DispensersViewVM + { + get + { + return ServiceLocator.Current.GetInstance<DispensersViewVM>(); + } + } + + public static DispenserTypesViewVM DispenserTypesViewVM + { + get + { + return ServiceLocator.Current.GetInstance<DispenserTypesViewVM>(); + } + } + + public static LiquidsViewVM LiquidsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<LiquidsViewVM>(); + } + } + + public static CartridgesViewVM CartridgesViewVM + { + get + { + return ServiceLocator.Current.GetInstance<CartridgesViewVM>(); + } + } + + public static CartridgeTypesViewVM CartridgeTypesViewVM + { + get + { + return ServiceLocator.Current.GetInstance<CartridgeTypesViewVM>(); + } + } } }
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationDisplayPanelVersionsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationDisplayPanelVersionsViewVM.cs new file mode 100644 index 000000000..be458136a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationDisplayPanelVersionsViewVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class ApplicationDisplayPanelVersionsViewVM : DbTableViewModel<ApplicationDisplayPanelVersion> + { + public ApplicationDisplayPanelVersionsViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationFirmwareVersionsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationFirmwareVersionsViewVM.cs new file mode 100644 index 000000000..0814988ba --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationFirmwareVersionsViewVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class ApplicationFirmwareVersionsViewVM : DbTableViewModel<ApplicationFirmwareVersion> + { + public ApplicationFirmwareVersionsViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationOsVersionsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationOsVersionsViewVM.cs new file mode 100644 index 000000000..3cdd8acb7 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationOsVersionsViewVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class ApplicationOsVersionsViewVM : DbTableViewModel<ApplicationOsVersion> + { + public ApplicationOsVersionsViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationVersionsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationVersionsViewVM.cs new file mode 100644 index 000000000..6e25fe321 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationVersionsViewVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class ApplicationVersionsViewVM : DbTableViewModel<ApplicationVersion> + { + public ApplicationVersionsViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CartridgeTypesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CartridgeTypesViewVM.cs new file mode 100644 index 000000000..c8c6ba00b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CartridgeTypesViewVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class CartridgeTypesViewVM : DbTableViewModel<CartridgeType> + { + public CartridgeTypesViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CartridgesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CartridgesViewVM.cs new file mode 100644 index 000000000..8db217013 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CartridgesViewVM.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class CartridgesViewVM : DbTableViewModel<Cartridge> + { + public CartridgesViewVM(INotificationProvider notification) : base(notification) + { + + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ConfigurationsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ConfigurationsViewVM.cs new file mode 100644 index 000000000..617faab31 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ConfigurationsViewVM.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class ConfigurationsViewVM : DbTableViewModel<Configuration> + { + public ConfigurationsViewVM(INotificationProvider notification) : base(notification) + { + + } + + protected override void InitializeEntity(Configuration entity) + { + base.InitializeEntity(entity); + entity.CreationDate = DateTime.Now; + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs index 7f6dd8d5f..b6d77748e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs @@ -9,10 +9,17 @@ using Tango.MachineStudio.Common.Notifications; using Tango.MachineStudio.DB.Managers; using Tango.SharedUI; using Tango.MachineStudio.DB.ExtensionMethods; +using System.Data.Entity.Infrastructure; +using GalaSoft.MvvmLight.Messaging; +using Tango.MachineStudio.DB.Messages; +using System.Collections.ObjectModel; +using System.Reflection; +using Tango.MachineStudio.Common.StudioApplication; +using System.ComponentModel; namespace Tango.MachineStudio.DB.ViewModels { - public abstract class DbTableViewModel<T> : ViewModel where T : class, IObservableEntity + public abstract class DbTableViewModel<T> : ViewModel, IShutdownRequestBlocker where T : class, IObservableEntity { private INotificationProvider _notification; @@ -23,9 +30,10 @@ namespace Tango.MachineStudio.DB.ViewModels { _notification = notification; Adapter = ObservablesEntitiesAdapter.Instance; + ValidationErrors = new ObservableCollection<string>(); AddCommand = new RelayCommand(OnAdd); - EditCommand = new RelayCommand(OnEdit,(x) => SelectedEntity != null); + EditCommand = new RelayCommand(OnEdit, (x) => SelectedEntity != null); DeleteCommand = new RelayCommand(OnDelete, (x) => SelectedEntity != null); DialogOKCommand = new RelayCommand(() => OnDialogOKPressed(DialogOpenMode, EditEntity)); DialogCancelCommand = new RelayCommand(() => OnDialogCancelPressed(DialogOpenMode, EditEntity)); @@ -93,6 +101,16 @@ namespace Tango.MachineStudio.DB.ViewModels set { _filter = value; RaisePropertyChangedAuto(); OnFilterChanged(value); } } + private ObservableCollection<String> _validationErrors; + /// <summary> + /// Gets or sets the validation errors. + /// </summary> + public ObservableCollection<String> ValidationErrors + { + get { return _validationErrors; } + set { _validationErrors = value; RaisePropertyChangedAuto(); } + } + /// <summary> /// Gets or sets the dialog OK command. /// </summary> @@ -118,13 +136,49 @@ namespace Tango.MachineStudio.DB.ViewModels /// </summary> public RelayCommand DeleteCommand { get; set; } + protected override void OnValidating() + { + base.OnValidating(); + ValidationErrors.Clear(); + + foreach (var prop in typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => !x.PropertyType.IsGenericType && x.PropertyType.IsClass && !x.Name.Contains("Guid"))) + { + if (prop.GetValue(EditEntity) == null) + { + ValidationErrors.Add(prop.Name + " is required"); + } + } + } + /// <summary> /// Called when delete command invoked. /// </summary> - protected virtual void OnDelete() + protected virtual async void OnDelete() { - SelectedEntity.Deleted = true; - SelectedEntity.Save(); + using (_notification.PushTaskItem("Saving changes to database...")) + { + var dependenctEntities = SelectedEntity.GetDependentEntitiesNameAndGuid(); + + if (dependenctEntities.Count > 0) + { + _notification.ShowError("The selected entity is being used by " + dependenctEntities.Count + " other entities." + Environment.NewLine + "Please delete any dependencies and try again." + Environment.NewLine + Environment.NewLine + String.Join(Environment.NewLine,dependenctEntities.Select(x => x.Key + ", ID: " + x.Value))); + return; + } + + try + { + SelectedEntity.Deleted = true; + await SelectedEntity.SaveAsync(); + } + catch (Exception ex) + { + SelectedEntity.Deleted = false; + Adapter.Invalidate(); + _notification.ShowError("Could not delete entity."); + } + + SelectedEntity = null; + } } /// <summary> @@ -132,9 +186,11 @@ namespace Tango.MachineStudio.DB.ViewModels /// </summary> protected virtual void OnEdit() { + ValidationErrors.Clear(); DialogOpenMode = DialogOpenMode.Editing; EditEntity = GetEditableEntity(DialogOpenMode); - _notification.ShowDialog(DialogOpenMode, this); + //_notification.ShowDialog(DialogOpenMode, this); + Messenger.Default.Send(new OpenEntityEditViewMessage(DialogOpenMode, this, typeof(T))); IsDialogOpen = true; } @@ -143,9 +199,11 @@ namespace Tango.MachineStudio.DB.ViewModels /// </summary> protected virtual void OnAdd() { + ValidationErrors.Clear(); DialogOpenMode = DialogOpenMode.Adding; EditEntity = GetEditableEntity(DialogOpenMode); - _notification.ShowDialog(DialogOpenMode, this); + //_notification.ShowDialog(DialogOpenMode, this); + Messenger.Default.Send(new OpenEntityEditViewMessage(DialogOpenMode, this, typeof(T))); IsDialogOpen = true; } @@ -153,8 +211,14 @@ namespace Tango.MachineStudio.DB.ViewModels /// Called when dialog closes with OK button. /// </summary> /// <param name="mode">The mode.</param> - protected virtual void OnDialogOKPressed(DialogOpenMode mode, T entity) + protected virtual async void OnDialogOKPressed(DialogOpenMode mode, T entity) { + if (!Validate()) return; + + if (ValidationErrors.Count > 0) return; + + Messenger.Default.Send(new CloseEntityEditViewMessage()); + if (mode == DialogOpenMode.Editing) { entity.ShallowCopyTo(SelectedEntity); @@ -163,10 +227,26 @@ namespace Tango.MachineStudio.DB.ViewModels OnBeforeEntitySave(mode, entity); - entity.Save(); - IsDialogOpen = false; - SelectedEntity = EditEntity; - SelectedEntity = null; + using (_notification.PushTaskItem("Saving changes to database...")) + { + try + { + await entity.SaveAsync(); + } + catch (DbUpdateException ex) + { + Adapter.Invalidate(); + _notification.ShowError("Could not save entity." + Environment.NewLine + ex.InnerException.InnerException != null ? ex.InnerException.InnerException.Message : ex.InnerException.Message); + } + catch (Exception ex) + { + Adapter.Invalidate(); + _notification.ShowError("Could not save entity." + Environment.NewLine + "Please make sure all fields are properly populated."); + } + IsDialogOpen = false; + SelectedEntity = EditEntity; + SelectedEntity = null; + } } /// <summary> @@ -174,7 +254,7 @@ namespace Tango.MachineStudio.DB.ViewModels /// </summary> /// <param name="mode">The mode.</param> /// <param name="entity">The entity.</param> - protected virtual void OnBeforeEntitySave(DialogOpenMode mode,T entity) + protected virtual void OnBeforeEntitySave(DialogOpenMode mode, T entity) { } @@ -185,6 +265,7 @@ namespace Tango.MachineStudio.DB.ViewModels /// <param name="mode">The mode.</param> protected virtual void OnDialogCancelPressed(DialogOpenMode mode, T entity) { + Messenger.Default.Send(new CloseEntityEditViewMessage()); IsDialogOpen = false; } @@ -209,12 +290,31 @@ namespace Tango.MachineStudio.DB.ViewModels protected virtual void OnFilterChanged(String filter) { + String viewSourceName = this.GetType().Name.Replace("ViewVM", "ViewSource"); + ICollectionView collectionView = Adapter.GetType().GetProperty(viewSourceName).GetValue(Adapter) as ICollectionView; + collectionView.Filter = (entity) => + { + return + entity. + GetType(). + GetProperties(BindingFlags.Public | BindingFlags.Instance). + Where(x => x.Name != "Deleted" && x.Name != "ID" && x.Name != "LastUpdated"). + Where(x => !x.PropertyType.IsGenericType && (x.PropertyType.IsClass || x.PropertyType == typeof(String))). + Select(prop => prop.GetValue(entity).ToString()). + ToList(). + Any(x => x.ToLower().Contains(filter.ToLower())); + }; } protected virtual void InitializeEntity(T entity) { } + + public Task<bool> OnShutdownRequest() + { + return Task.FromResult(true); + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DispenserTypesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DispenserTypesViewVM.cs new file mode 100644 index 000000000..5ffe0d58c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DispenserTypesViewVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class DispenserTypesViewVM : DbTableViewModel<DispenserType> + { + public DispenserTypesViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DispensersViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DispensersViewVM.cs new file mode 100644 index 000000000..0242c1dc7 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DispensersViewVM.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class DispensersViewVM : DbTableViewModel<Dispenser> + { + public DispensersViewVM(INotificationProvider notification) : base(notification) + { + + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EmbeddedFirmwareVersionsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EmbeddedFirmwareVersionsViewVM.cs new file mode 100644 index 000000000..a248d919a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EmbeddedFirmwareVersionsViewVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class EmbeddedFirmwareVersionsViewVM : DbTableViewModel<EmbeddedFirmwareVersion> + { + public EmbeddedFirmwareVersionsViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EmbeddedSoftwareVersionsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EmbeddedSoftwareVersionsViewVM.cs new file mode 100644 index 000000000..b6436203d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EmbeddedSoftwareVersionsViewVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class EmbeddedSoftwareVersionsViewVM : DbTableViewModel<EmbeddedSoftwareVersion> + { + public EmbeddedSoftwareVersionsViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/HardwareVersionsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/HardwareVersionsViewVM.cs new file mode 100644 index 000000000..02c90c442 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/HardwareVersionsViewVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class HardwareVersionsViewVM : DbTableViewModel<HardwareVersion> + { + public HardwareVersionsViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/IdsPacksViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/IdsPacksViewVM.cs new file mode 100644 index 000000000..202dd959f --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/IdsPacksViewVM.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class IdsPacksViewVM : DbTableViewModel<IdsPack> + { + public IdsPacksViewVM(INotificationProvider notification) : base(notification) + { + + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/LiquidsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/LiquidsViewVM.cs new file mode 100644 index 000000000..e57f6606e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/LiquidsViewVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class LiquidsViewVM : DbTableViewModel<Liquid> + { + public LiquidsViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MachineVersionsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MachineVersionsViewVM.cs new file mode 100644 index 000000000..6a24f7d4c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MachineVersionsViewVM.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class MachineVersionsViewVM : DbTableViewModel<MachineVersion> + { + public MachineVersionsViewVM(INotificationProvider notification) : base(notification) + { + + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MainViewVM.cs index 11c0adc0e..a0ce93a5a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MainViewVM.cs @@ -3,17 +3,16 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows; using Tango.SharedUI; namespace Tango.MachineStudio.DB.ViewModels { public class MainViewVM : ViewModel { - public String Text { get; set; } - public MainViewVM() : base() { - Text = "Hi ROy"; + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/OrganizationsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/OrganizationsViewVM.cs index a394f9faa..0327557f1 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/OrganizationsViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/OrganizationsViewVM.cs @@ -13,14 +13,5 @@ namespace Tango.MachineStudio.DB.ViewModels public OrganizationsViewVM(INotificationProvider notification) : base(notification) { } - - protected override void OnFilterChanged(string filter) - { - Adapter.OrganizationsViewSource.Filter = (x) => - { - var org = x as Organization; - return org.Name.Contains(filter); - }; - } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/UsersViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/UsersViewVM.cs index 0b65d48ab..6af1184aa 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/UsersViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/UsersViewVM.cs @@ -6,6 +6,7 @@ using System.Text; using System.Threading.Tasks; using Tango.DAL.Observables; using Tango.MachineStudio.Common.Notifications; +using SimpleValidator.Extensions; namespace Tango.MachineStudio.DB.ViewModels { @@ -72,5 +73,23 @@ namespace Tango.MachineStudio.DB.ViewModels } } } + + protected override void OnValidating() + { + base.OnValidating(); + + if (EditEntity.Email != null) + { + if (Adapter.Users.ToList().Exists(x => x.Email.ToLower() == EditEntity.Email.ToLower())) + { + ValidationErrors.Add("Email already exist"); + } + } + + if (!EditEntity.Password.IsMinLength(4)) + { + ValidationErrors.Add("Password must have at least 4 characters"); + } + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/AddressesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/AddressesView.xaml index ee46a9c11..e338f3c0f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/AddressesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/AddressesView.xaml @@ -10,7 +10,7 @@ d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.AddressesViewVM}"> <Grid> <controls:DbTableView> - <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.Addresses}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True"> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.AddressesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True"> <DataGrid.Columns> <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionView.xaml new file mode 100644 index 000000000..a1c8d6d7e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionView.xaml @@ -0,0 +1,25 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ApplicationDisplayPanelVersionView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300"> + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Version:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Version,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionView.xaml.cs new file mode 100644 index 000000000..6d372eaf7 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class ApplicationDisplayPanelVersionView : UserControl + { + public ApplicationDisplayPanelVersionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionsView.xaml new file mode 100644 index 000000000..704f5f5e2 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionsView.xaml @@ -0,0 +1,23 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ApplicationDisplayPanelVersionsView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ApplicationDisplayPanelVersionsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.ApplicationDisplayPanelVersionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Version" Binding="{Binding Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionsView.xaml.cs new file mode 100644 index 000000000..e514117dd --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionsView.xaml.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class ApplicationDisplayPanelVersionsView : UserControl + { + public ApplicationDisplayPanelVersionsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionView.xaml new file mode 100644 index 000000000..70fde065d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionView.xaml @@ -0,0 +1,25 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ApplicationFirmwareVersionView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300"> + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Version:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Version,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionView.xaml.cs new file mode 100644 index 000000000..b63b05ccf --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class ApplicationFirmwareVersionView : UserControl + { + public ApplicationFirmwareVersionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionsView.xaml new file mode 100644 index 000000000..a216f4a1f --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionsView.xaml @@ -0,0 +1,23 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ApplicationFirmwareVersionsView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ApplicationFirmwareVersionsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.ApplicationFirmwareVersionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Version" Binding="{Binding Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionsView.xaml.cs new file mode 100644 index 000000000..855e51523 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionsView.xaml.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class ApplicationFirmwareVersionsView : UserControl + { + public ApplicationFirmwareVersionsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionView.xaml new file mode 100644 index 000000000..48f96597b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionView.xaml @@ -0,0 +1,25 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ApplicationOsVersionView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300"> + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Version:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Version,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionView.xaml.cs new file mode 100644 index 000000000..019fd207e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class ApplicationOsVersionView : UserControl + { + public ApplicationOsVersionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionsView.xaml new file mode 100644 index 000000000..f53c182c3 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionsView.xaml @@ -0,0 +1,23 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ApplicationOsVersionsView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ApplicationOsVersionsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.ApplicationOsVersionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Version" Binding="{Binding Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionsView.xaml.cs new file mode 100644 index 000000000..ca244d95b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionsView.xaml.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class ApplicationOsVersionsView : UserControl + { + public ApplicationOsVersionsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionView.xaml new file mode 100644 index 000000000..c5e33f3fa --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionView.xaml @@ -0,0 +1,25 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ApplicationVersionView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300"> + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Version:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Version,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionView.xaml.cs new file mode 100644 index 000000000..bde27ee0d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class ApplicationVersionView : UserControl + { + public ApplicationVersionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionsView.xaml new file mode 100644 index 000000000..09df0fee4 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionsView.xaml @@ -0,0 +1,23 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ApplicationVersionsView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ApplicationVersionsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.ApplicationVersionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Version" Binding="{Binding Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionsView.xaml.cs new file mode 100644 index 000000000..23cab4296 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionsView.xaml.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class ApplicationVersionsView : UserControl + { + public ApplicationVersionsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypeView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypeView.xaml new file mode 100644 index 000000000..a81f05646 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypeView.xaml @@ -0,0 +1,29 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.CartridgeTypeView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:vm="clr-namespace:Tango.MachineStudio.DB.ViewModels" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="400" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=vm:CartridgeTypesViewVM, IsDesignTimeCreatable=False}"> + + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Code:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Code,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypeView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypeView.xaml.cs new file mode 100644 index 000000000..fc23e504e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypeView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class CartridgeTypeView : UserControl + { + public CartridgeTypeView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypesView.xaml new file mode 100644 index 000000000..d17f79c8d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypesView.xaml @@ -0,0 +1,24 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.CartridgeTypesView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.CartridgeTypesViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.CartridgeTypesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Code" Binding="{Binding Code}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypesView.xaml.cs new file mode 100644 index 000000000..428ebb296 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypesView.xaml.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class CartridgeTypesView : UserControl + { + public CartridgeTypesView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeView.xaml new file mode 100644 index 000000000..98adef136 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeView.xaml @@ -0,0 +1,29 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.CartridgeView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:vm="clr-namespace:Tango.MachineStudio.DB.ViewModels" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="400" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=vm:CartridgesViewVM, IsDesignTimeCreatable=False}"> + + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Serial Number:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.SerialNumber}"></TextBox> + <TextBlock Text="Cartridge Type:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.CartridgeTypes}" SelectedItem="{Binding EditEntity.CartridgeTypes,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeView.xaml.cs new file mode 100644 index 000000000..d2402426c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class CartridgeView : UserControl + { + public CartridgeView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgesView.xaml new file mode 100644 index 000000000..3fa7d0200 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgesView.xaml @@ -0,0 +1,24 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.CartridgesView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.CartridgesViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.CartridgesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Serial Number" Binding="{Binding SerialNumber}"></DataGridTextColumn> + <DataGridTextColumn Header="Cartridge Type" Binding="{Binding CartridgeTypes.Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgesView.xaml.cs new file mode 100644 index 000000000..27adfa44e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgesView.xaml.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class CartridgesView : UserControl + { + public CartridgesView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationView.xaml new file mode 100644 index 000000000..afbaf660a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationView.xaml @@ -0,0 +1,53 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ConfigurationView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + xmlns:vm="clr-namespace:Tango.MachineStudio.DB.ViewModels" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=vm:ConfigurationsViewVM, IsDesignTimeCreatable=False}"> + + <UserControl.Resources> + <DataTemplate x:Key="comTemplate"> + <TextBlock><Run Text="{Binding Name}"></Run><Run>,</Run> <Run Text="{Binding Version}"></Run></TextBlock> + </DataTemplate> + </UserControl.Resources> + + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + <TextBlock Text="Creation Date:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.CreationDate,Mode=TwoWay}" IsReadOnly="True"></TextBox> + <TextBlock Text="Application Version:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.ApplicationVersions}" SelectedItem="{Binding EditEntity.ApplicationVersions,Mode=TwoWay}" ItemTemplate="{StaticResource comTemplate}"></ComboBox> + + <TextBlock Text="Application Firmware Version:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.ApplicationFirmwareVersions}" SelectedItem="{Binding EditEntity.ApplicationFirmwareVersions,Mode=TwoWay}" ItemTemplate="{StaticResource comTemplate}"></ComboBox> + + <TextBlock Text="Application OS Version:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.ApplicationOsVersions}" SelectedItem="{Binding EditEntity.ApplicationOsVersions,Mode=TwoWay}" ItemTemplate="{StaticResource comTemplate}"></ComboBox> + + <TextBlock Text="Display Panel Version:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.ApplicationDisplayPanelVersions}" SelectedItem="{Binding EditEntity.ApplicationDisplayPanelVersions,Mode=TwoWay}" ItemTemplate="{StaticResource comTemplate}"></ComboBox> + + <TextBlock Text="Embedded Firmware Version:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.EmbeddedFirmwareVersions}" SelectedItem="{Binding EditEntity.EmbeddedFirmwareVersions,Mode=TwoWay}" ItemTemplate="{StaticResource comTemplate}"></ComboBox> + + <TextBlock Text="Embedded Software Version:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.EmbeddedSoftwareVersions}" SelectedItem="{Binding EditEntity.EmbeddedSoftwareVersions,Mode=TwoWay}" ItemTemplate="{StaticResource comTemplate}"></ComboBox> + + <TextBlock Text="Hardware Version:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.HardwareVersions}" SelectedItem="{Binding EditEntity.HardwareVersions,Mode=TwoWay}" ItemTemplate="{StaticResource comTemplate}"></ComboBox> + + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationView.xaml.cs new file mode 100644 index 000000000..8772bbae9 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class ConfigurationView : UserControl + { + public ConfigurationView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationsView.xaml new file mode 100644 index 000000000..235e49cc3 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationsView.xaml @@ -0,0 +1,30 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ConfigurationsView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ConfigurationsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.ConfigurationsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + <DataGridTextColumn Header="Creation Date" Binding="{Binding CreationDate}"></DataGridTextColumn> + <DataGridTextColumn Header="Application Version" Binding="{Binding ApplicationVersions.Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Application OS" Binding="{Binding ApplicationOsVersions.Name}"></DataGridTextColumn> + <DataGridTextColumn Header="Application Firmware Version" Binding="{Binding ApplicationFirmwareVersions.Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Display Panel" Binding="{Binding ApplicationDisplayPanelVersions.Name}"></DataGridTextColumn> + <DataGridTextColumn Header="Embedded Firmware Version" Binding="{Binding EmbeddedFirmwareVersions.Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Embedded Software Version" Binding="{Binding EmbeddedSoftwareVersions.Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Hardware Version" Binding="{Binding HardwareVersions.Version}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationsView.xaml.cs new file mode 100644 index 000000000..de3fc9010 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationsView.xaml.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class ConfigurationsView : UserControl + { + public ConfigurationsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypeView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypeView.xaml new file mode 100644 index 000000000..b6e3336b3 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypeView.xaml @@ -0,0 +1,29 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.DispenserTypeView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:vm="clr-namespace:Tango.MachineStudio.DB.ViewModels" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="400" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=vm:DispenserTypesViewVM, IsDesignTimeCreatable=False}"> + + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Code:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Code,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypeView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypeView.xaml.cs new file mode 100644 index 000000000..f13875714 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypeView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class DispenserTypeView : UserControl + { + public DispenserTypeView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml new file mode 100644 index 000000000..874629128 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml @@ -0,0 +1,24 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.DispenserTypesView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.DispenserTypesViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.DispenserTypesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Code" Binding="{Binding Code}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml.cs new file mode 100644 index 000000000..89e0b05c1 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class DispenserTypesView : UserControl + { + public DispenserTypesView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserView.xaml new file mode 100644 index 000000000..7dc4ec1ff --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserView.xaml @@ -0,0 +1,29 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.DispenserView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:vm="clr-namespace:Tango.MachineStudio.DB.ViewModels" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="400" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=vm:DispensersViewVM, IsDesignTimeCreatable=False}"> + + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Serial Number:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.SerialNumber}"></TextBox> + <TextBlock Text="Dispenser Type:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.DispenserTypes}" SelectedItem="{Binding EditEntity.DispenserTypes,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserView.xaml.cs new file mode 100644 index 000000000..4ad5d74fe --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class DispenserView : UserControl + { + public DispenserView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispensersView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispensersView.xaml new file mode 100644 index 000000000..7fdb70bbe --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispensersView.xaml @@ -0,0 +1,24 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.DispensersView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.DispensersViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.DispensersViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Serial Number" Binding="{Binding SerialNumber}"></DataGridTextColumn> + <DataGridTextColumn Header="Dispenser Type" Binding="{Binding DispenserTypes.Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispensersView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispensersView.xaml.cs new file mode 100644 index 000000000..d86bd2e31 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispensersView.xaml.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class DispensersView : UserControl + { + public DispensersView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionView.xaml new file mode 100644 index 000000000..56dccb7dc --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionView.xaml @@ -0,0 +1,25 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.EmbeddedFirmwareVersionView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300"> + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Version:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Version,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionView.xaml.cs new file mode 100644 index 000000000..82aa4f7b4 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class EmbeddedFirmwareVersionView : UserControl + { + public EmbeddedFirmwareVersionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionsView.xaml new file mode 100644 index 000000000..219230d32 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionsView.xaml @@ -0,0 +1,23 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.EmbeddedFirmwareVersionsView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.EmbeddedFirmwareVersionsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.EmbeddedFirmwareVersionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Version" Binding="{Binding Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionsView.xaml.cs new file mode 100644 index 000000000..39c50aa39 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionsView.xaml.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class EmbeddedFirmwareVersionsView : UserControl + { + public EmbeddedFirmwareVersionsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionView.xaml new file mode 100644 index 000000000..279c15c84 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionView.xaml @@ -0,0 +1,25 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.EmbeddedSoftwareVersionView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300"> + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Version:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Version,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionView.xaml.cs new file mode 100644 index 000000000..e2e626fb5 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class EmbeddedSoftwareVersionView : UserControl + { + public EmbeddedSoftwareVersionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionsView.xaml new file mode 100644 index 000000000..64814a416 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionsView.xaml @@ -0,0 +1,23 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.EmbeddedSoftwareVersionsView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.EmbeddedSoftwareVersionsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.EmbeddedSoftwareVersionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Version" Binding="{Binding Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionsView.xaml.cs new file mode 100644 index 000000000..55f7a03a6 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionsView.xaml.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class EmbeddedSoftwareVersionsView : UserControl + { + public EmbeddedSoftwareVersionsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionView.xaml new file mode 100644 index 000000000..45d36fb14 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionView.xaml @@ -0,0 +1,25 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.HardwareVersionView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300"> + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Version:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Version,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionView.xaml.cs new file mode 100644 index 000000000..1419434bf --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class HardwareVersionView : UserControl + { + public HardwareVersionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionsView.xaml new file mode 100644 index 000000000..4a60ffcaa --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionsView.xaml @@ -0,0 +1,23 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.HardwareVersionsView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.HardwareVersionsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.HardwareVersionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Version" Binding="{Binding Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionsView.xaml.cs new file mode 100644 index 000000000..0e552cdb7 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionsView.xaml.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class HardwareVersionsView : UserControl + { + public HardwareVersionsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackView.xaml new file mode 100644 index 000000000..308a549fa --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackView.xaml @@ -0,0 +1,64 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.IdsPackView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:vm="clr-namespace:Tango.MachineStudio.DB.ViewModels" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="400" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=vm:IdsPacksViewVM, IsDesignTimeCreatable=False}"> + + <UserControl.Resources> + <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> + </UserControl.Resources> + + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name}"></TextBox> + <TextBlock Text="Configuration:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.Configurations}" SelectedItem="{Binding EditEntity.Configuration,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox> + <TextBlock Text="Dispenser:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.Dispensers}" SelectedItem="{Binding EditEntity.Dispenser,Mode=TwoWay}"> + <ComboBox.ItemTemplate> + <DataTemplate> + <TextBlock><Run Text="{Binding SerialNumber}"></Run><Run>,</Run> <Run Text="{Binding DispenserTypes.Name}"></Run></TextBlock> + </DataTemplate> + </ComboBox.ItemTemplate> + </ComboBox> + <TextBlock Text="Liquid:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.Liquids}" SelectedItem="{Binding EditEntity.Liquid,Mode=TwoWay}"> + <ComboBox.ItemTemplate> + <DataTemplate> + <StackPanel Orientation="Horizontal"> + <Rectangle Width="16" Height="16" VerticalAlignment="Center"> + <Rectangle.Fill> + <SolidColorBrush Color="{Binding Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </Rectangle.Fill> + </Rectangle> + <TextBlock Margin="5 0 0 0" Text="{Binding Name}" VerticalAlignment="Center"></TextBlock> + </StackPanel> + </DataTemplate> + </ComboBox.ItemTemplate> + </ComboBox> + <TextBlock Text="Cartridge:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.Cartridges}" SelectedItem="{Binding EditEntity.Cartridge,Mode=TwoWay}"> + <ComboBox.ItemTemplate> + <DataTemplate> + <TextBlock><Run Text="{Binding SerialNumber}"></Run><Run>,</Run> <Run Text="{Binding CartridgeTypes.Name}"></Run></TextBlock> + </DataTemplate> + </ComboBox.ItemTemplate> + </ComboBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackView.xaml.cs new file mode 100644 index 000000000..766b3087e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class IdsPackView : UserControl + { + public IdsPackView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml new file mode 100644 index 000000000..df1557ec3 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml @@ -0,0 +1,57 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.IdsPacksView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.IdsPacksViewVM}"> + + <UserControl.Resources> + <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> + </UserControl.Resources> + + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.IdsPacksViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + <DataGridTextColumn Header="Configuration" Binding="{Binding Configuration.Name}"></DataGridTextColumn> + <DataGridTemplateColumn Header="Dispenser"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock><Run Text="{Binding Dispenser.SerialNumber}"></Run><Run>,</Run> <Run Text="{Binding Dispenser.DispenserTypes.Name}"></Run></TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="Liquid"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <StackPanel Orientation="Horizontal"> + <Rectangle Width="16" Height="16" VerticalAlignment="Center"> + <Rectangle.Fill> + <SolidColorBrush Color="{Binding Liquid.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </Rectangle.Fill> + </Rectangle> + <TextBlock Margin="5 0 0 0" Text="{Binding Liquid.Name}" VerticalAlignment="Center"></TextBlock> + </StackPanel> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="Cartridge"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock><Run Text="{Binding Cartridge.SerialNumber}"></Run><Run>,</Run> <Run Text="{Binding Dispenser.CartridgeTypes.Name}"></Run></TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml.cs new file mode 100644 index 000000000..3f1a0189b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class IdsPacksView : UserControl + { + public IdsPacksView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidView.xaml new file mode 100644 index 000000000..19bcc2674 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidView.xaml @@ -0,0 +1,42 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.LiquidView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:vm="clr-namespace:Tango.MachineStudio.DB.ViewModels" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="400" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=vm:LiquidsViewVM, IsDesignTimeCreatable=False}"> + + <UserControl.Resources> + <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> + + <Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource {x:Type TabItem}}"> + <Setter Property="mahapps:ControlsHelper.HeaderFontSize" Value="14" /> + <Setter Property="Margin" Value="2" /> + </Style> + </UserControl.Resources> + + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Code:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Code,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + <TextBlock Text="Version:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Version,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Color:" FontWeight="Bold"></TextBlock> + <colorPicker:ColorPickerCombo SelectedColor="{Binding EditEntity.Color,Mode=TwoWay,Converter={StaticResource ColorToIntegerConverter},UpdateSourceTrigger=PropertyChanged}"></colorPicker:ColorPickerCombo> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidView.xaml.cs new file mode 100644 index 000000000..653def003 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class LiquidView : UserControl + { + public LiquidView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidsView.xaml new file mode 100644 index 000000000..749b0ccd7 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidsView.xaml @@ -0,0 +1,41 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.LiquidsView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.LiquidsViewVM}"> + + <UserControl.Resources> + <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> + </UserControl.Resources> + + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.LiquidsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Code" Binding="{Binding Code}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + <DataGridTextColumn Header="Version" Binding="{Binding Version}"></DataGridTextColumn> + <DataGridTemplateColumn Header="Color"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <Rectangle Width="50"> + <Rectangle.Fill> + <SolidColorBrush Color="{Binding Color,Converter={StaticResource ColorToIntegerConverter},Mode=TwoWay}"></SolidColorBrush> + </Rectangle.Fill> + </Rectangle> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidsView.xaml.cs new file mode 100644 index 000000000..2d68d5ef5 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidsView.xaml.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class LiquidsView : UserControl + { + public LiquidsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionView.xaml new file mode 100644 index 000000000..50a1c790b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionView.xaml @@ -0,0 +1,27 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.MachineVersionView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300"> + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Version:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Version,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + <TextBlock Text="Default Configuration:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.Configurations}" SelectedItem="{Binding EditEntity.Configuration,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionView.xaml.cs new file mode 100644 index 000000000..5e284cd47 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class MachineVersionView : UserControl + { + public MachineVersionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionsView.xaml new file mode 100644 index 000000000..08cac568f --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionsView.xaml @@ -0,0 +1,24 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.MachineVersionsView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.MachineVersionsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.MachineVersionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + <DataGridTextColumn Header="Version" Binding="{Binding Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Default Configuration" Binding="{Binding Configuration.Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionsView.xaml.cs new file mode 100644 index 000000000..275445917 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionsView.xaml.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class MachineVersionsView : UserControl + { + public MachineVersionsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachinesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachinesView.xaml index f5913bd2c..ebd3b2c7e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachinesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachinesView.xaml @@ -10,7 +10,7 @@ d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.MachinesViewVM}"> <Grid> <controls:DbTableView> - <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.Machines}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.MachinesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> <DataGrid.Columns> <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PermissionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PermissionsView.xaml index d773dc58a..9455fd519 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PermissionsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PermissionsView.xaml @@ -10,7 +10,7 @@ d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.PermissionsViewVM}"> <Grid> <controls:DbTableView> - <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.Permissions}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True"> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.PermissionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True"> <DataGrid.Columns> <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RolesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RolesView.xaml index dcb61eacb..858cfd37b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RolesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RolesView.xaml @@ -15,7 +15,7 @@ <Grid> <controls:DbTableView> - <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.Roles}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True"> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.RolesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True"> <DataGrid.Columns> <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UserView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UserView.xaml index e63c1c131..6bfb2fbb8 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UserView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UserView.xaml @@ -23,7 +23,7 @@ <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True" IsEnabled="False"></TextBox> <TextBlock Text="Email:" FontWeight="Bold"></TextBlock> - <TextBox Text="{Binding EditEntity.Email,Mode=TwoWay}"></TextBox> + <TextBox Text="{Binding EditEntity.Email,Mode=TwoWay, ValidatesOnNotifyDataErrors=True}"></TextBox> <TextBlock Text="Password:" FontWeight="Bold"></TextBlock> <TextBox Text="{Binding EditEntity.Password,Mode=TwoWay}"></TextBox> <TextBlock Text="Roles:" FontWeight="Bold"></TextBlock> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UsersView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UsersView.xaml index 5b6c2e842..ad3814185 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UsersView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UsersView.xaml @@ -16,7 +16,7 @@ <Grid> <controls:DbTableView> - <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.Users}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True"> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.UsersViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True"> <DataGrid.Columns> <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml index c7c636d53..6c7cb2b95 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml @@ -12,12 +12,16 @@ xmlns:commonControls="clr-namespace:Tango.MachineStudio.Common.Controls;assembly=Tango.MachineStudio.Common" xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1270" Background="White" DataContext="{Binding MainViewVM, Source={StaticResource Locator}}"> + d:DesignHeight="720" d:DesignWidth="1270" DataContext="{Binding MainViewVM, Source={StaticResource Locator}}"> + + <UserControl.Background> + <ImageBrush ImageSource="../Images/seamless-grid.jpg" Stretch="None" TileMode="Tile" ViewportUnits="Absolute" Viewport="0,0,32,32"></ImageBrush> + </UserControl.Background> <Grid> <Grid> <Grid.ColumnDefinitions> - <ColumnDefinition Width="200"/> - <ColumnDefinition Width="486*"/> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Border Background="{StaticResource AccentColorBrush}" Margin="5" CornerRadius="5"> @@ -34,7 +38,7 @@ <materialDesign:PackIcon Kind="Table" Width="24" Height="24"></materialDesign:PackIcon> <TextBlock Margin="5 0 0 0" Style="{StaticResource MaterialDesignBody2TextBlock}" VerticalAlignment="Center" Text="{Binding Header}" Background="Transparent" HorizontalAlignment="Stretch"></TextBlock> </StackPanel> - <materialDesign:PackIcon ToolTip="View Table" VerticalAlignment="Center" DockPanel.Dock="Right" Kind="ArrowRight"></materialDesign:PackIcon> + <materialDesign:PackIcon Margin="10 0 0 0" ToolTip="View Table" VerticalAlignment="Center" DockPanel.Dock="Right" Kind="ArrowRight"></materialDesign:PackIcon> </DockPanel> </DataTemplate> </ListBox.ItemTemplate> @@ -42,12 +46,112 @@ </Border> <Grid Grid.Column="1"> - <Grid.Background> - <ImageBrush ImageSource="../Images/seamless-grid.jpg" Stretch="None" TileMode="Tile" ViewportUnits="Absolute" Viewport="0,0,32,32"></ImageBrush> - </Grid.Background> - <commonControls:MdiContainerControl ItemsSource="{x:Static managers:ViewsManager.DisplayedViews}"></commonControls:MdiContainerControl> </Grid> </Grid> + + <Grid IsHitTestVisible="False"> + <Grid.Background> + <SolidColorBrush Color="Black" Opacity="0.8"></SolidColorBrush> + </Grid.Background> + + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="Opacity" Value="1"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=IsEditViewOpen}" Value="False"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible"> + <DiscreteBooleanKeyFrame Value="False" KeyTime="00:00:00"></DiscreteBooleanKeyFrame> + </BooleanAnimationUsingKeyFrames> + <DoubleAnimation Storyboard.TargetProperty="Opacity" To="0" Duration="00:00:0.3"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible"> + <DiscreteBooleanKeyFrame Value="True" KeyTime="00:00:00"></DiscreteBooleanKeyFrame> + </BooleanAnimationUsingKeyFrames> + <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="00:00:0.3"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + </Grid> + + <Grid x:Name="grid" HorizontalAlignment="Right" MinWidth="300" RenderTransformOrigin="1,0" VerticalAlignment="Top" Margin="0 100 0 0"> + + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleY="1" ScaleX="0"></ScaleTransform> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=IsEditViewOpen}" Value="False"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="0" Duration="00:00:0.3"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.3"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + + <Border Padding="10" CornerRadius="10 0 0 10" Background="White"> + <Border.Effect> + <DropShadowEffect/> + </Border.Effect> + <DockPanel LastChildFill="True"> + <StackPanel Orientation="Horizontal" DockPanel.Dock="Top" VerticalAlignment="Top"> + <materialDesign:PackIcon x:Name="icon" VerticalAlignment="Center" Width="32" Height="32" Foreground="{StaticResource AccentColorBrush}" /> + <TextBlock x:Name="txtTitle" Margin="10 0 0 0" Foreground="{StaticResource AccentColorBrush}" FontSize="16"></TextBlock> + </StackPanel> + <StackPanel DockPanel.Dock="Bottom"> + <ItemsControl ItemsSource="{Binding ValidationErrors}"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon VerticalAlignment="Center" Kind="Exclamation" Foreground="Red" Width="16" Height="16"></materialDesign:PackIcon> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" Foreground="Red" Text="{Binding}"></TextBlock> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Right"> + <Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 8 0" Command="{Binding DialogOKCommand}"> + ACCEPT + </Button> + <Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0" Command="{Binding DialogCancelCommand}"> + CANCEL + </Button> + </StackPanel> + </StackPanel> + <ScrollViewer Margin="0 10 0 0" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Padding="5"> + <ContentPresenter x:Name="presenter"></ContentPresenter> + </ScrollViewer> + </DockPanel> + </Border> + + <Thumb HorizontalAlignment="Left" Opacity="0" Width="5" VerticalAlignment="Stretch" Cursor="SizeWE" DragDelta="Thumb_DragDelta"></Thumb> + </Grid> </Grid> </UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml.cs index 9e327b575..1ffdf7eb0 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml.cs @@ -1,4 +1,6 @@ -using System; +using GalaSoft.MvvmLight.Messaging; +using MaterialDesignThemes.Wpf; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -12,6 +14,9 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.MachineStudio.DB.Messages; +using Tango.MachineStudio.DB.ViewModels; +using Tango.MachineStudio.DB.Views.DBViews; using Tango.SharedUI; using Tango.SharedUI.Controls; @@ -25,6 +30,50 @@ namespace Tango.MachineStudio.DB.Views public MainDBView() : base() { InitializeComponent(); + + Messenger.Default.Register<OpenEntityEditViewMessage>(this, HandleOpenEntityViewMessage); + Messenger.Default.Register<CloseEntityEditViewMessage>(this, HandleCloseEntityViewMessage); + } + + public bool IsEditViewOpen + { + get { return (bool)GetValue(IsEditViewOpenProperty); } + set { SetValue(IsEditViewOpenProperty, value); } + } + public static readonly DependencyProperty IsEditViewOpenProperty = + DependencyProperty.Register("IsEditViewOpen", typeof(bool), typeof(MainDBView), new PropertyMetadata(false)); + + private void HandleCloseEntityViewMessage(CloseEntityEditViewMessage message) + { + IsEditViewOpen = false; + } + + private void HandleOpenEntityViewMessage(OpenEntityEditViewMessage message) + { + Type viewType = typeof(MainDBView).Assembly.GetType(typeof(OrganizationView).Namespace + "." + message.EntityType.Name + "View"); + + presenter.DataContext = message.Context; + var view = Activator.CreateInstance(viewType) as FrameworkElement; + view.DataContext = message.Context; + grid.DataContext = message.Context; + presenter.Content = view; + icon.Kind = (message.DialogOpenMode == DialogOpenMode.Editing ? PackIconKind.TableEdit : PackIconKind.Plus); + txtTitle.Text = (message.DialogOpenMode == DialogOpenMode.Editing ? "Edit " : "Add New ") + message.EntityType.Name.ToTitle(); + + IsEditViewOpen = true; + } + + private void Thumb_DragDelta(object sender, System.Windows.Controls.Primitives.DragDeltaEventArgs e) + { + if (double.IsNaN(grid.Width)) + { + grid.Width = grid.ActualWidth; + } + + if (grid.Width + -e.HorizontalChange > 100) + { + grid.Width += -e.HorizontalChange; + } } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Windows/DBDialogWindow.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Windows/DBDialogWindow.xaml new file mode 100644 index 000000000..83cd48926 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Windows/DBDialogWindow.xaml @@ -0,0 +1,32 @@ +<mahapps:MetroWindow x:Class="Tango.MachineStudio.DB.Windows.DBDialogWindow" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Windows" + mc:Ignorable="d" + Title="Machine Studio" Height="450" Width="650" EnableDWMDropShadow="True" ShowCloseButton="False" WindowTransitionsEnabled="False" ShowMaxRestoreButton="False" ShowMinButton="False" TitleCaps="False" BorderThickness="1" WindowStartupLocation="CenterOwner"> + <Grid> + <Border Margin="16"> + <DockPanel LastChildFill="True"> + <StackPanel Orientation="Horizontal" DockPanel.Dock="Top" VerticalAlignment="Top"> + <materialDesign:PackIcon Kind="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=IconKind}" VerticalAlignment="Center" Width="32" Height="32" Foreground="{StaticResource AccentColorBrush}" /> + <TextBlock Margin="10 0 0 0" Foreground="{StaticResource AccentColorBrush}" FontSize="16" Text="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=InnerTitle}"></TextBlock> + </StackPanel> + <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Right" DockPanel.Dock="Bottom"> + <Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 8 0" Command="{Binding DialogOKCommand}" Click="OnOKClicked"> + ACCEPT + </Button> + <Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0" Command="{Binding DialogCancelCommand}" Click="OnCancelClicked"> + CANCEL + </Button> + </StackPanel> + <ScrollViewer Margin="0 10 0 10" VerticalScrollBarVisibility="Auto" Padding="5"> + <ContentPresenter x:Name="presenter"></ContentPresenter> + </ScrollViewer> + </DockPanel> + </Border> + </Grid> +</mahapps:MetroWindow> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Windows/DBDialogWindow.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Windows/DBDialogWindow.xaml.cs new file mode 100644 index 000000000..d9629c642 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Windows/DBDialogWindow.xaml.cs @@ -0,0 +1,68 @@ +using MahApps.Metro.Controls; +using MaterialDesignThemes.Wpf; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; +namespace Tango.MachineStudio.DB.Windows +{ + /// <summary> + /// Interaction logic for DBDialogWindow.xaml + /// </summary> + public partial class DBDialogWindow : MetroWindow + { + public DBDialogWindow() + { + InitializeComponent(); + } + + public String InnerTitle + { + get { return (String)GetValue(InnerTitleProperty); } + set { SetValue(InnerTitleProperty, value); } + } + public static readonly DependencyProperty InnerTitleProperty = + DependencyProperty.Register("InnerTitle", typeof(String), typeof(DBDialogWindow), new PropertyMetadata(null)); + + + + public PackIconKind IconKind + { + get { return (PackIconKind)GetValue(IconKindProperty); } + set { SetValue(IconKindProperty, value); } + } + + // Using a DependencyProperty as the backing store for IconKind. This enables animation, styling, binding, etc... + public static readonly DependencyProperty IconKindProperty = + DependencyProperty.Register("IconKind", typeof(PackIconKind), typeof(DBDialogWindow), new PropertyMetadata(PackIconKind.TableEdit)); + + + + + public DBDialogWindow(FrameworkElement content) : this() + { + presenter.Content = content; + } + + private void OnOKClicked(object sender, RoutedEventArgs e) + { + DialogResult = true; + Close(); + } + + private void OnCancelClicked(object sender, RoutedEventArgs e) + { + DialogResult = false; + Close(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/packages.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/packages.config index ab8c25d56..138a48ec7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/packages.config +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/packages.config @@ -8,4 +8,6 @@ <package id="MaterialDesignThemes" version="2.3.1.953" targetFramework="net46" /> <package id="MvvmLight" version="5.3.0.0" targetFramework="net46" /> <package id="MvvmLightLibs" version="5.3.0.0" targetFramework="net46" /> + <package id="SimpleValidator" version="0.6.1.0" targetFramework="net46" /> + <package id="WriteableBitmapEx" version="1.5.0.0" targetFramework="net46" /> </packages>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MdiContainerControl.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MdiContainerControl.xaml index 3896347fe..b248a4aec 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MdiContainerControl.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MdiContainerControl.xaml @@ -7,7 +7,7 @@ xmlns:local="clr-namespace:Tango.MachineStudio.Common.Controls" xmlns:converters="clr-namespace:Tango.MachineStudio.Common.Converters" mc:Ignorable="d" - d:DesignHeight="300" d:DesignWidth="300" Background="White"> + d:DesignHeight="300" d:DesignWidth="300"> <UserControl.Resources> <converters:PointToMarginConverter x:Key="PointToMarginConverter"></converters:PointToMarginConverter> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ExtensionMethods/IStudioMessageExtensions.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ExtensionMethods/IStudioMessageExtensions.cs new file mode 100644 index 000000000..83183f328 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ExtensionMethods/IStudioMessageExtensions.cs @@ -0,0 +1,15 @@ +using GalaSoft.MvvmLight.Messaging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.MachineStudio.Common.Messages; + +public static class IStudioMessageExtensions +{ + public static void Send(this IStudioMessage message) + { + Messenger.Default.Send(message); + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ExtensionMethods/UserExtensions.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ExtensionMethods/UserExtensions.cs index a11ee7e8a..a6c98319e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ExtensionMethods/UserExtensions.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ExtensionMethods/UserExtensions.cs @@ -7,7 +7,7 @@ using Tango.DAL.Observables; public static class UserExtensions { - public static bool HasPermission(this User user, PermissionsEnum permission) + public static bool HasPermission(this User user, Permissions permission) { return user.UsersRoles.Select(x => x.Role).ToList().SelectMany(x => x.RolesPermissions).ToList().Exists(x => x.Permission.Code == permission.ToInt32()); } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioModule.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioModule.cs index 36c885340..902a45a2f 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioModule.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioModule.cs @@ -19,7 +19,7 @@ namespace Tango.MachineStudio.Common FrameworkElement MainView { get; } - PermissionsEnum Permission { get; } + Permissions Permission { get; } bool IsInitialized { get; } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Messages/IStudioMessage.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Messages/IStudioMessage.cs new file mode 100644 index 000000000..7d1232c7b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Messages/IStudioMessage.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.Common.Messages +{ + public interface IStudioMessage + { + + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs index e14df21ba..a45f9a847 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs @@ -1,17 +1,43 @@ using MaterialDesignThemes.Wpf; using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; +using System.Windows.Media; namespace Tango.MachineStudio.Common.Notifications { public interface INotificationProvider { - bool ShowDialog<T>(PackIconKind icon, String title, object context) where T : FrameworkElement; + ObservableCollection<TaskItem> TaskItems { get; } - bool ShowDialog(PackIconKind icon, String title, FrameworkElement content, object context); + TaskItem CurrentTaskItem { get; } + + bool HasTaskItems { get; } + + void PushTaskItem(TaskItem taskItem); + + TaskItem PushTaskItem(String message); + + void PopTaskItem(TaskItem taskItem); + + bool? ShowModalWindow(Window window); + + bool ShowModalWindow<T>(PackIconKind icon, String title, object context) where T : FrameworkElement; + + bool ShowModalWindow(PackIconKind icon, String title, FrameworkElement content, object context); + + bool? ShowDialog(PackIconKind icon, Brush iconColor, String message, bool hasCancel); + + void ShowInfo(String message); + + void ShowWarnning(String message); + + void ShowError(String message); + + bool ShowQuestion(String message); } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/TaskItem.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/TaskItem.cs new file mode 100644 index 000000000..0cf5e2c8e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/TaskItem.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; + +namespace Tango.MachineStudio.Common.Notifications +{ + public class TaskItem : ExtendedObject, IDisposable + { + private INotificationProvider _notificationProvider; + + public TaskItem(INotificationProvider notificationProvider) + { + _notificationProvider = notificationProvider; + } + + private String _message; + public String Message + { + get { return _message; } + set { _message = value; RaisePropertyChangedAuto(); } + } + + public void Pop() + { + _notificationProvider.PopTaskItem(this); + } + + public void Push() + { + _notificationProvider.PushTaskItem(this); + } + + public void Dispose() + { + Pop(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IShutdownRequestBlocker.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IShutdownRequestBlocker.cs new file mode 100644 index 000000000..a157bd598 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IShutdownRequestBlocker.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.Common.StudioApplication +{ + public interface IShutdownRequestBlocker + { + Task<bool> OnShutdownRequest(); + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs new file mode 100644 index 000000000..0ee27fbf6 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.Common.StudioApplication +{ + public interface IStudioApplicationManager + { + void ShutDown(); + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioViewModel.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioViewModel.cs new file mode 100644 index 000000000..6b7984faf --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioViewModel.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.SharedUI; + +namespace Tango.MachineStudio.Common +{ + public abstract class StudioViewModel : ViewModel + { + public abstract Task<bool> RequestShutdown(); + } + + public abstract class StudioViewModel<T> : ViewModel<T> where T : IView + { + public abstract Task<bool> OnShutdownRequest(); + + public StudioViewModel(T view) : base(view) + { + + } + } +} + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj index c94e6fbdc..1aa5216b4 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj @@ -31,14 +31,30 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> + <Reference Include="GalaSoft.MvvmLight, Version=5.3.0.19026, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL"> + <HintPath>..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll</HintPath> + </Reference> + <Reference Include="GalaSoft.MvvmLight.Extras, Version=5.3.0.19032, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL"> + <HintPath>..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath> + </Reference> + <Reference Include="GalaSoft.MvvmLight.Platform, Version=5.3.0.19032, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL"> + <HintPath>..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath> + </Reference> <Reference Include="MaterialDesignColors, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\MaterialDesignColors.1.1.2\lib\net45\MaterialDesignColors.dll</HintPath> </Reference> <Reference Include="MaterialDesignThemes.Wpf, Version=2.3.1.953, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\MaterialDesignThemes.2.3.1.953\lib\net45\MaterialDesignThemes.Wpf.dll</HintPath> </Reference> + <Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath> + </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> + <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\System.Windows.Interactivity.dll</HintPath> + <Private>True</Private> + </Reference> <Reference Include="System.Xml" /> <Reference Include="Microsoft.CSharp" /> <Reference Include="System.Core" /> @@ -53,6 +69,12 @@ <Reference Include="PresentationFramework" /> </ItemGroup> <ItemGroup> + <Compile Include="StudioApplication\IStudioApplicationManager.cs" /> + <Compile Include="StudioApplication\IShutdownRequestBlocker.cs" /> + <Compile Include="ExtensionMethods\IStudioMessageExtensions.cs" /> + <Compile Include="Messages\IStudioMessage.cs" /> + <Compile Include="Notifications\TaskItem.cs" /> + <Compile Include="ValidationRules\Required.cs" /> <Page Include="Controls\MdiContainerControl.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ValidationRules/Required.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ValidationRules/Required.cs new file mode 100644 index 000000000..84f274965 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ValidationRules/Required.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Controls; + +namespace Tango.MachineStudio.Common.ValidationRules +{ + public class Required : ValidationRule + { + public override ValidationResult Validate(object value, CultureInfo cultureInfo) + { + return new ValidationResult(!String.IsNullOrWhiteSpace(value.ToStringSafe()), "Required"); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/packages.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/packages.config index 0c779127b..f67c854e3 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/packages.config +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/packages.config @@ -1,5 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <packages> + <package id="CommonServiceLocator" version="1.3" targetFramework="net46" /> <package id="MaterialDesignColors" version="1.1.2" targetFramework="net46" /> <package id="MaterialDesignThemes" version="2.3.1.953" targetFramework="net46" /> + <package id="MvvmLightLibs" version="5.3.0.0" targetFramework="net46" /> </packages>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs index b3b92b6ab..ca553de1e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs @@ -14,13 +14,9 @@ namespace Tango.MachineStudio.UI /// </summary> public partial class App : Application { - public static ObservablesEntitiesAdapter DbAdapter { get; set; } - protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); - - DbAdapter = ObservablesEntitiesAdapter.Instance; } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/account.png b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/account.png Binary files differnew file mode 100644 index 000000000..46f0d38fc --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/account.png diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs index 3f7d4cad8..9193cfd3e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs @@ -1,4 +1,5 @@ using MahApps.Metro.Controls; +using Microsoft.Practices.ServiceLocation; using System; using System.Collections.Generic; using System.Linq; @@ -13,6 +14,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.MachineStudio.Common.StudioApplication; namespace Tango.MachineStudio.UI { @@ -26,8 +28,15 @@ namespace Tango.MachineStudio.UI public MainWindow() { InitializeComponent(); - Instance = this; + + this.Closing += MainWindow_Closing; + } + + private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) + { + e.Cancel = true; + ServiceLocator.Current.GetInstance<IStudioApplicationManager>().ShutDown(); } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs index 8e0fd2220..b1ba03109 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs @@ -7,17 +7,49 @@ using System.Windows; using MaterialDesignThemes.Wpf; using Tango.MachineStudio.Common.Notifications; using Tango.MachineStudio.UI.Windows; +using System.Windows.Media; +using Tango.Core; +using System.Collections.ObjectModel; namespace Tango.MachineStudio.UI.Notifications { - public class DefaultNotificationProvider : INotificationProvider + public class DefaultNotificationProvider : ExtendedObject, INotificationProvider { - public bool ShowDialog<T>(PackIconKind icon, string title, object context) where T : FrameworkElement + public ObservableCollection<TaskItem> TaskItems { get; private set; } + + public bool HasTaskItems { - return ShowDialog(icon, title, Activator.CreateInstance<T>(), context); + get { return TaskItems.Count > 0; } } - public bool ShowDialog(PackIconKind icon, string title, FrameworkElement content, object context) + private TaskItem _currentTaskItem; + + public TaskItem CurrentTaskItem + { + get { return _currentTaskItem; } + set { _currentTaskItem = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(HasTaskItems)); } + } + + public DefaultNotificationProvider() + { + TaskItems = new ObservableCollection<TaskItem>(); + } + + public bool ShowModalWindow<T>(PackIconKind icon, string title, object context) where T : FrameworkElement + { + return ShowModalWindow(icon, title, Activator.CreateInstance<T>(), context); + } + + public bool? ShowModalWindow(Window window) + { + window.Owner = Application.Current.MainWindow; + MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; + bool result = window.ShowDialog().Value; + MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; + return result; + } + + public bool ShowModalWindow(PackIconKind icon, string title, FrameworkElement content, object context) { DialogWindow dialog = new DialogWindow(content); dialog.DataContext = context; @@ -28,5 +60,69 @@ namespace Tango.MachineStudio.UI.Notifications MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; return result; } + + public bool? ShowDialog(PackIconKind icon, Brush iconColor, string message, bool hasCancel) + { + MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; + + var result = new MessageBoxWindow() + { + Owner = Application.Current.MainWindow, + Message = message, + IconKind = icon, + IconColor = iconColor, + HasCancel = hasCancel + + }.ShowDialog(); + + MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; + return result; + } + + public void ShowError(string message) + { + ShowDialog(PackIconKind.Exclamation, Brushes.Red, message, false); + } + + public void ShowInfo(string message) + { + ShowDialog(PackIconKind.Information, Brushes.Black, message, false); + } + + public bool ShowQuestion(string message) + { + return ShowDialog(PackIconKind.CommentQuestionOutline, Brushes.Black, message, true).Value; + } + + public void ShowWarnning(string message) + { + ShowDialog(PackIconKind.Exclamation, Brushes.DarkOrange, message, false); + } + + public void PushTaskItem(TaskItem taskItem) + { + TaskItems.Add(taskItem); + CurrentTaskItem = taskItem; + } + + public TaskItem PushTaskItem(string message) + { + TaskItem item = new TaskItem(this); + item.Message = message; + PushTaskItem(item); + return item; + } + + public void PopTaskItem(TaskItem taskItem) + { + TaskItems.Remove(taskItem); + + if (TaskItems.Count > 0) + { + CurrentTaskItem = TaskItems.Last(); + } + + RaisePropertyChanged(nameof(HasTaskItems)); + } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml index f23776ec2..2a8dd9f28 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml @@ -12,17 +12,9 @@ <Border Margin="16"> <DockPanel LastChildFill="True"> <StackPanel Orientation="Horizontal" DockPanel.Dock="Top" VerticalAlignment="Top"> - <materialDesign:PackIcon Kind="TableEdit" VerticalAlignment="Center" Width="32" Height="32" Foreground="{StaticResource AccentColorBrush}" /> + <materialDesign:PackIcon Kind="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=IconKind}" VerticalAlignment="Center" Width="32" Height="32" Foreground="{StaticResource AccentColorBrush}" /> <TextBlock Margin="10 0 0 0" Foreground="{StaticResource AccentColorBrush}" FontSize="16" Text="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=InnerTitle}"></TextBlock> </StackPanel> - <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Right" DockPanel.Dock="Bottom"> - <Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 8 0" Command="{Binding DialogOKCommand}" Click="OnOKClicked"> - ACCEPT - </Button> - <Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0" Command="{Binding DialogCancelCommand}" Click="OnCancelClicked"> - CANCEL - </Button> - </StackPanel> <ScrollViewer Margin="0 10 0 10" VerticalScrollBarVisibility="Auto" Padding="5"> <ContentPresenter x:Name="presenter"></ContentPresenter> </ScrollViewer> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml.cs index c946d2b88..31dd3d644 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml.cs @@ -1,4 +1,5 @@ using MahApps.Metro.Controls; +using MaterialDesignThemes.Wpf; using System; using System.Collections.Generic; using System.Linq; @@ -38,6 +39,17 @@ namespace Tango.MachineStudio.UI.Windows + public PackIconKind IconKind + { + get { return (PackIconKind)GetValue(IconKindProperty); } + set { SetValue(IconKindProperty, value); } + } + public static readonly DependencyProperty IconKindProperty = + DependencyProperty.Register("IconKind", typeof(PackIconKind), typeof(DialogWindow), new PropertyMetadata(PackIconKind.Information)); + + + + public DialogWindow(FrameworkElement content) : this() { presenter.Content = content; diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/MessageBoxWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/MessageBoxWindow.xaml new file mode 100644 index 000000000..4f3b826fe --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/MessageBoxWindow.xaml @@ -0,0 +1,40 @@ +<Window x:Class="Tango.MachineStudio.UI.Notifications.MessageBoxWindow" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:local="clr-namespace:Tango.MachineStudio.UI.Notifications" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + mc:Ignorable="d" + Title="Machine Studio" MinHeight="220" MaxHeight="600" SizeToContent="Height" Width="570" Opacity="0" AllowsTransparency="True" WindowStyle="None" WindowStartupLocation="CenterOwner" Background="Transparent"> + + <Window.Resources> + <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"></BooleanToVisibilityConverter> + </Window.Resources> + + <Grid> + <Border Background="White" CornerRadius="10" Padding="10" Margin="20"> + <Border.Effect> + <DropShadowEffect ShadowDepth="0" BlurRadius="10"></DropShadowEffect> + </Border.Effect> + <DockPanel LastChildFill="True"> + <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Right" DockPanel.Dock="Bottom"> + <Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 8 0" Click="OnOKClicked"> + ACCEPT + </Button> + <Button Visibility="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=HasCancel,Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0" Click="OnCancelClicked"> + CANCEL + </Button> + </StackPanel> + <Grid> + <StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="0 30 0 0"> + <materialDesign:PackIcon Kind="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=IconKind}" VerticalAlignment="Top" Width="50" Height="50" Foreground="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=IconColor}" /> + <TextBlock Padding="0 10 0 0" TextWrapping="Wrap" Margin="10 0 0 0" VerticalAlignment="Top" FontSize="14" Text="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=Message}" Width="400"></TextBlock> + </StackPanel> + </Grid> + </DockPanel> + </Border> + </Grid> +</Window> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/MessageBoxWindow.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/MessageBoxWindow.xaml.cs new file mode 100644 index 000000000..7ce4965ef --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/MessageBoxWindow.xaml.cs @@ -0,0 +1,83 @@ +using MahApps.Metro.Controls; +using MaterialDesignThemes.Wpf; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.UI.Notifications +{ + /// <summary> + /// Interaction logic for MessageBoxWindow.xaml + /// </summary> + public partial class MessageBoxWindow : Window + { + public MessageBoxWindow() + { + InitializeComponent(); + this.Loaded += MessageBoxWindow_Loaded; + } + + private void MessageBoxWindow_Loaded(object sender, RoutedEventArgs e) + { + DoubleAnimation ani = new DoubleAnimation(); + ani.To = 1; + ani.Duration = TimeSpan.FromSeconds(0.5); + this.BeginAnimation(Window.OpacityProperty, ani); + } + + public String Message + { + get { return (String)GetValue(MessageProperty); } + set { SetValue(MessageProperty, value); } + } + public static readonly DependencyProperty MessageProperty = + DependencyProperty.Register("Message", typeof(String), typeof(MessageBoxWindow), new PropertyMetadata(null)); + + public Brush IconColor + { + get { return (Brush)GetValue(IconColorProperty); } + set { SetValue(IconColorProperty, value); } + } + public static readonly DependencyProperty IconColorProperty = + DependencyProperty.Register("IconColor", typeof(Brush), typeof(MessageBoxWindow), new PropertyMetadata(Brushes.Black)); + + public PackIconKind IconKind + { + get { return (PackIconKind)GetValue(IconKindProperty); } + set { SetValue(IconKindProperty, value); } + } + public static readonly DependencyProperty IconKindProperty = + DependencyProperty.Register("IconKind", typeof(PackIconKind), typeof(MessageBoxWindow), new PropertyMetadata(PackIconKind.Information)); + + public bool HasCancel + { + get { return (bool)GetValue(HasCancelProperty); } + set { SetValue(HasCancelProperty, value); } + } + public static readonly DependencyProperty HasCancelProperty = + DependencyProperty.Register("HasCancel", typeof(bool), typeof(MessageBoxWindow), new PropertyMetadata(false)); + + private void OnOKClicked(object sender, RoutedEventArgs e) + { + DialogResult = true; + Close(); + } + + private void OnCancelClicked(object sender, RoutedEventArgs e) + { + DialogResult = false; + Close(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs new file mode 100644 index 000000000..b95a74a3e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs @@ -0,0 +1,53 @@ +using Microsoft.Practices.ServiceLocation; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Tango.Core.Helpers; +using Tango.MachineStudio.Common.StudioApplication; +using Tango.MachineStudio.Common.Navigation; +using GalaSoft.MvvmLight.Ioc; +using System.Reflection; +using System.Collections; + +namespace Tango.MachineStudio.UI.StudioApplication +{ + public class DefaultStudioApplicationManager : IStudioApplicationManager + { + private INavigationManager _navigationManager; + + public DefaultStudioApplicationManager(INavigationManager navigationManager) + { + _navigationManager = navigationManager; + } + + public async void ShutDown() + { + _navigationManager.NavigateTo(NavigationView.ShutdownView); + + await Task.Factory.StartNew(async () => + { + + //Do Shutdown Procedures... + foreach (var vm in ServiceLocator.Current.GetAllInstancesByBase<IShutdownRequestBlocker>()) + { + var result = await vm.OnShutdownRequest(); + if (!result) + { + ThreadsHelper.InvokeUI(() => + { + _navigationManager.NavigateTo(NavigationView.MainView); + }); + return; + } + } + + Thread.Sleep(3000); + Environment.Exit(0); + + }); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj index 9d2860241..be0c1a829 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj @@ -70,6 +70,9 @@ <Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <HintPath>..\..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath> </Reference> + <Reference Include="SimpleValidator, Version=0.6.1.0, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\..\packages\SimpleValidator.0.6.1.0\lib\net40\SimpleValidator.dll</HintPath> + </Reference> <Reference Include="System" /> <Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.Data" /> @@ -96,10 +99,14 @@ <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </ApplicationDefinition> + <Compile Include="StudioApplication\DefaultStudioApplicationManager.cs" /> <Compile Include="Authentication\DefaultAuthenticationProvider.cs" /> <Compile Include="Modules\DefaultStudioModuleLoader.cs" /> <Compile Include="Navigation\DefaultNavigationManager.cs" /> <Compile Include="Notifications\DefaultNotificationProvider.cs" /> + <Compile Include="Notifications\MessageBoxWindow.xaml.cs"> + <DependentUpon>MessageBoxWindow.xaml</DependentUpon> + </Compile> <Compile Include="SupervisingController\IMainView.cs" /> <Compile Include="ViewModels\LoadingViewVM.cs" /> <Compile Include="ViewModels\LoginViewVM.cs" /> @@ -136,6 +143,10 @@ <DependentUpon>MainWindow.xaml</DependentUpon> <SubType>Code</SubType> </Compile> + <Page Include="Notifications\MessageBoxWindow.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Themes\Generic.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> @@ -232,7 +243,12 @@ <ItemGroup> <Resource Include="Images\machine-trans.png" /> </ItemGroup> - <ItemGroup /> + <ItemGroup> + <Resource Include="Images\account.png" /> + </ItemGroup> + <ItemGroup> + <Folder Include="Controls\" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <PropertyGroup> <PostBuildEvent>$(TargetDir)linkgen.exe -s "$(TargetPath)" -d "$(TargetDir)Utilities\Machine Studio.lnk"</PostBuildEvent> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs index 5095dfc93..f4a7a7502 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs @@ -7,10 +7,12 @@ using Tango.MachineStudio.Common.Authentication; using Tango.MachineStudio.Common.Modules; using Tango.MachineStudio.Common.Navigation; using Tango.MachineStudio.Common.Notifications; +using Tango.MachineStudio.Common.StudioApplication; using Tango.MachineStudio.UI.Authentication; using Tango.MachineStudio.UI.Modules; using Tango.MachineStudio.UI.Navigation; using Tango.MachineStudio.UI.Notifications; +using Tango.MachineStudio.UI.StudioApplication; using Tango.MachineStudio.UI.SupervisingController; using Tango.MachineStudio.UI.ViewModels; using Tango.MachineStudio.UI.Views; @@ -45,11 +47,13 @@ namespace Tango.MachineStudio.UI SimpleIoc.Default.Unregister<IAuthenticationProvider>(); SimpleIoc.Default.Unregister<INavigationManager>(); SimpleIoc.Default.Unregister<IStudioModuleLoader>(); + SimpleIoc.Default.Unregister<IStudioApplicationManager>(); SimpleIoc.Default.Register<INotificationProvider, DefaultNotificationProvider>(); SimpleIoc.Default.Register<IAuthenticationProvider, DefaultAuthenticationProvider>(); SimpleIoc.Default.Register<INavigationManager, DefaultNavigationManager>(); SimpleIoc.Default.Register<IStudioModuleLoader, DefaultStudioModuleLoader>(); + SimpleIoc.Default.Register<IStudioApplicationManager, DefaultStudioApplicationManager>(); SimpleIoc.Default.Register<MainViewVM>(); SimpleIoc.Default.Register<LoadingViewVM>(); diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs index 72ab5aca9..f50b734f4 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs @@ -4,26 +4,58 @@ using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; +using Tango.Core.Threading; +using Tango.DAL.Observables; using Tango.MachineStudio.Common.Modules; using Tango.MachineStudio.Common.Navigation; +using Tango.MachineStudio.Common.Notifications; using Tango.SharedUI; namespace Tango.MachineStudio.UI.ViewModels { public class LoadingViewVM : ViewModel { - public LoadingViewVM(INavigationManager navigationManager, IStudioModuleLoader studioModuleLoader) + private INotificationProvider _notificationProvider; + private INavigationManager _navigationManager; + private IStudioModuleLoader _studioModuleLoader; + + public LoadingViewVM(INavigationManager navigationManager, IStudioModuleLoader studioModuleLoader, INotificationProvider notificationProvider) + { + _navigationManager = navigationManager; + _studioModuleLoader = studioModuleLoader; + _notificationProvider = notificationProvider; + Load(); + } + + private void Load() { - Task.Factory.StartNew(() => + StaThreadHelper.StartStaThread(() => { Thread.Sleep(3000); - }).ContinueWith((x) => - { - - studioModuleLoader.LoadModules(); - navigationManager.NavigateTo(NavigationView.LoginView); - - }, TaskScheduler.FromCurrentSynchronizationContext()); + try + { + ObservablesEntitiesAdapter.Instance.Initialize(); + InvokeUI(() => + { + _studioModuleLoader.LoadModules(); + _navigationManager.NavigateTo(NavigationView.LoginView); + }); + } + catch (Exception ex) + { + InvokeUINow(() => + { + if (_notificationProvider.ShowQuestion("An error occurred while trying to connect to Twine database." + Environment.NewLine + "Would you like to try again?")) + { + Load(); + } + else + { + Environment.Exit(0); + } + }); + } + }); } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs index 67c116790..6fe90fa99 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs @@ -1,13 +1,17 @@ using System; +using System.Collections; using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; using Tango.Core.Commands; +using Tango.Core.Cryptography; using Tango.MachineStudio.Common.Authentication; using Tango.MachineStudio.Common.Navigation; +using Tango.MachineStudio.Common.Notifications; +using Tango.Settings; using Tango.SharedUI; namespace Tango.MachineStudio.UI.ViewModels @@ -16,34 +20,59 @@ namespace Tango.MachineStudio.UI.ViewModels { private IAuthenticationProvider _authenticationProvider; private INavigationManager _navigationManager; + private INotificationProvider _notificationProvider; + private Rfc2898Cryptographer cryptographer; private String _email; + [Required(ErrorMessage = "Email is required")] + [EmailAddress(ErrorMessage = "Please enter a valid email")] public String Email { get { return _email; } set { _email = value; RaisePropertyChangedAuto(); } } - public RelayCommand<PasswordBox> LoginCommand { get; set; } + private bool _rememberMe; - public LoginViewVM(IAuthenticationProvider authenticationProvider, INavigationManager navigationManager) + public bool RememberMe { + get { return _rememberMe; } + set { _rememberMe = value; RaisePropertyChangedAuto(); } + } + + + public RelayCommand<String> LoginCommand { get; set; } + + public LoginViewVM(IAuthenticationProvider authenticationProvider, INavigationManager navigationManager, INotificationProvider notificationProvider) + { + _notificationProvider = notificationProvider; _navigationManager = navigationManager; _authenticationProvider = authenticationProvider; - LoginCommand = new RelayCommand<PasswordBox>(Login); + LoginCommand = new RelayCommand<String>(Login); + + cryptographer = new Rfc2898Cryptographer(); + Email = SettingsManager.Default.MachineStudio.LastLoginEmail; + RememberMe = SettingsManager.Default.MachineStudio.RememberMe; } - private void Login(PasswordBox passwordBox) + private void Login(String password) { - String password = passwordBox.Password; - try - { - _authenticationProvider.Login(Email, password); - _navigationManager.NavigateTo(NavigationView.MainView); - } - catch (Exception ex) + if (Validate()) { - MessageBox.Show("Failed"); + try + { + _authenticationProvider.Login(Email, password); + _navigationManager.NavigateTo(NavigationView.MainView); + SettingsManager.Default.MachineStudio.LastLoginEmail = Email; + SettingsManager.Default.MachineStudio.RememberMe = RememberMe; + + SettingsManager.Default.MachineStudio.LastLoginPassword = RememberMe ? cryptographer.Encrypt(password) : null; + SettingsManager.SaveDefaultSettings(); + } + catch + { + _notificationProvider.ShowError("Invalid credentials. Please try again."); + } } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs index 213d1a83d..7ef47fabd 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -10,6 +10,7 @@ using Tango.Core.Commands; using Tango.MachineStudio.Common; using Tango.MachineStudio.Common.Authentication; using Tango.MachineStudio.Common.Modules; +using Tango.MachineStudio.Common.Notifications; using Tango.MachineStudio.UI.SupervisingController; using Tango.SharedUI; @@ -52,10 +53,24 @@ namespace Tango.MachineStudio.UI.ViewModels set { _studioModuleLoader = value; RaisePropertyChangedAuto(); } } - public MainViewVM(IMainView view, IAuthenticationProvider authenticationProvider, IStudioModuleLoader studioModuleLoader) : base(view) + private INotificationProvider _notificationProvider; + + public INotificationProvider NotificationProvider + { + get { return _notificationProvider; } + set { _notificationProvider = value; RaisePropertyChangedAuto(); } + } + + + public MainViewVM( + IMainView view, + IAuthenticationProvider authenticationProvider, + IStudioModuleLoader studioModuleLoader, + INotificationProvider notificationProvider) : base(view) { AuthenticationProvider = authenticationProvider; StudioModuleLoader = studioModuleLoader; + NotificationProvider = notificationProvider; StartModuleCommand = new RelayCommand<IStudioModule>(StartModule); diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoadingView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoadingView.xaml index ab0875023..459c8fde8 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoadingView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoadingView.xaml @@ -6,7 +6,7 @@ xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" DataContext="{Binding LoadingViewVM, Source={StaticResource Locator}}" Background="White"> + d:DesignHeight="720" d:DesignWidth="1280" Cursor="Wait" DataContext="{Binding LoadingViewVM, Source={StaticResource Locator}}" Background="White"> <Grid> <Grid HorizontalAlignment="Center" VerticalAlignment="Center"> <StackPanel> @@ -15,7 +15,7 @@ <TextBlock FontSize="70" Foreground="{StaticResource AccentColorBrush}">Machine Studio</TextBlock> </StackPanel> <TextBlock HorizontalAlignment="Right" FontSize="18" Margin="0 0 -50 0" Foreground="{StaticResource AccentColorBrush}">Twine Solutions</TextBlock> - <mahapps:ProgressRing Margin="20 60 20 20" Width="80" Height="80"></mahapps:ProgressRing> + <mahapps:ProgressRing Margin="20 60 20 40" Width="80" Height="80"></mahapps:ProgressRing> <TextBlock HorizontalAlignment="Center" FontSize="18" FontStyle="Italic">Loading, please wait...</TextBlock> </StackPanel> </Grid> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml index 60590a16b..1531370af 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml @@ -2,17 +2,41 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:rules="clr-namespace:Tango.MachineStudio.Common.ValidationRules;assembly=Tango.MachineStudio.Common" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" mc:Ignorable="d" d:DesignHeight="720" d:DesignWidth="1280" DataContext="{Binding LoginViewVM, Source={StaticResource Locator}}" Background="White"> + + <UserControl.Resources> + <rules:Required x:Key="Required"></rules:Required> + </UserControl.Resources> + + + <UserControl.InputBindings> + <KeyBinding Key="Return" Command="{Binding LoginCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=Password}"></KeyBinding> + </UserControl.InputBindings> <Grid> - <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="300"> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="40"> <Image Source="/Images/machine-trans.png" RenderOptions.BitmapScalingMode="Fant" Width="100"></Image> - <TextBox Margin="0 40 0 0" materialDesign:HintAssist.FloatingScale="0.50" materialDesign:HintAssist.Hint="Email" materialDesign:TextFieldAssist.TextBoxViewMargin="1 0 1 0" FontSize="24" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Text="{Binding Email,UpdateSourceTrigger=PropertyChanged}" /> - <PasswordBox x:Name="txtPass" Margin="0 20 0 0" materialDesign:HintAssist.FloatingScale="0.50" materialDesign:HintAssist.Hint="Password" materialDesign:TextFieldAssist.TextBoxViewMargin="1 0 1 0" FontSize="24" Style="{StaticResource MaterialDesignFloatingHintPasswordBox}" /> - <Button Margin="0 40 0 0" Height="50" Command="{Binding LoginCommand}" CommandParameter="{Binding ElementName=txtPass}">LOGIN</Button> + <TextBlock Margin="20 0 0 0" VerticalAlignment="Center" FontSize="70" Foreground="{StaticResource AccentColorBrush}">Machine Studio</TextBlock> + </StackPanel> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="320" Margin="0 120 0 0"> + <TextBlock HorizontalAlignment="Center" FontSize="24">Login to your account</TextBlock> + <Image Source="/Images/account.png" RenderOptions.BitmapScalingMode="Fant" Width="100" Margin="0 20 0 0"></Image> + <DockPanel Margin="0 20 0 0"> + <materialDesign:PackIcon Margin="0 0 0 0" Width="20" Height="20" VerticalAlignment="Top" Foreground="{Binding ElementName=txtEmail, Path=BorderBrush}" Kind="EmailOutline" /> + <TextBox x:Name="txtEmail" IsTabStop="True" Margin="5 0 0 0" materialDesign:HintAssist.FloatingScale="0.50" materialDesign:HintAssist.Hint="Email" materialDesign:TextFieldAssist.TextBoxViewMargin="1 0 1 0" FontSize="20" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Text="{Binding Email,UpdateSourceTrigger=PropertyChanged,ValidatesOnNotifyDataErrors=True}" AutomationProperties.IsRequiredForForm="True" /> + </DockPanel> + <DockPanel Margin="0 20 0 0"> + <materialDesign:PackIcon Margin="0 0 0 0" Width="20" Height="20" VerticalAlignment="Top" Foreground="{Binding ElementName=txtPass, Path=BorderBrush}" Kind="Key" /> + <PasswordBox x:Name="txtPass" PasswordChanged="txtPass_PasswordChanged" Margin="5 0 0 0" materialDesign:HintAssist.FloatingScale="0.50" materialDesign:HintAssist.Hint="Password" materialDesign:TextFieldAssist.TextBoxViewMargin="1 0 1 0" FontSize="20" Style="{StaticResource MaterialDesignFloatingHintPasswordBox}" AutomationProperties.IsRequiredForForm="True" /> + </DockPanel> + <CheckBox Margin="25 20 0 0" IsChecked="{Binding RememberMe}">Remember me</CheckBox> + <Button Margin="25 20 0 0" Height="50" Command="{Binding LoginCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=Password}" Content="LOGIN"> + + </Button> </StackPanel> </Grid> </UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml.cs index 0b3a9ae4f..027e37682 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml.cs @@ -12,17 +12,50 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using static Tango.SharedUI.Controls.MultiTransitionControl; +using SimpleValidator.Extensions; +using Tango.Settings; +using Tango.Core.Cryptography; namespace Tango.MachineStudio.UI.Views { /// <summary> /// Interaction logic for LoginView.xaml /// </summary> - public partial class LoginView : UserControl + public partial class LoginView : UserControl, ITransitionView { + private Rfc2898Cryptographer cryptographer; + public LoginView() { InitializeComponent(); + + cryptographer = new Rfc2898Cryptographer(); + } + + public String Password + { + get { return (String)GetValue(PasswordProperty); } + set { SetValue(PasswordProperty, value); } + } + public static readonly DependencyProperty PasswordProperty = + DependencyProperty.Register("Password", typeof(String), typeof(LoginView), new PropertyMetadata(null)); + + public void OnTransitionCompleted() + { + txtEmail.Focus(); + + if (txtEmail.Text.IsNotNullOrWhiteSpace()) + { + txtPass.Focus(); + } + + txtPass.Password = cryptographer.Decrypt(SettingsManager.Default.MachineStudio.LastLoginPassword); + } + + private void txtPass_PasswordChanged(object sender, RoutedEventArgs e) + { + Password = txtPass.Password; } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml index 98b6ecb73..cb7378666 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml @@ -3,36 +3,78 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" xmlns:dockablz="clr-namespace:Dragablz.Dockablz;assembly=Dragablz" xmlns:dragablz="clr-namespace:Dragablz;assembly=Dragablz" xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:db="clr-namespace:Tango.MachineStudio.DB.Views;assembly=Tango.MachineStudio.DB" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" mc:Ignorable="d" d:DesignHeight="720" d:DesignWidth="1270" Background="White" DataContext="{Binding MainViewVM, Source={StaticResource Locator}}"> <Grid> + <Grid.Style> + <Style TargetType="Grid"> + <Style.Triggers> + <DataTrigger Binding="{Binding NotificationProvider.HasTaskItems}" Value="True"> + <Setter Property="Cursor" Value="AppStarting"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding NotificationProvider.HasTaskItems}" Value="False"> + <Setter Property="Cursor" Value="Arrow"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + <materialDesign:DrawerHost IsLeftDrawerOpen="{Binding ElementName=MenuToggleButton, Path=IsChecked}"> <materialDesign:DrawerHost.LeftDrawerContent> - <DockPanel MinWidth="212"> - <Grid DockPanel.Dock="Top"> + <StackPanel MinWidth="300"> + <Grid> <ToggleButton Style="{StaticResource MaterialDesignHamburgerToggleButton}" HorizontalAlignment="Right" Margin="16" IsChecked="{Binding ElementName=MenuToggleButton, Path=IsChecked, Mode=TwoWay}" /> <StackPanel Margin="5 0 0 0" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center"> - <materialDesign:PackIcon VerticalAlignment="Center" Kind="Account" Foreground="{StaticResource AccentColorBrush}" Width="32" Height="32"></materialDesign:PackIcon> - <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">User Name</TextBlock> + <Image Source="/Images/account.png" RenderOptions.BitmapScalingMode="Fant" VerticalAlignment="Center" Width="50" Height="50"></Image> + <TextBlock FontSize="16" TextTrimming="CharacterEllipsis" MaxWidth="170" FontWeight="Bold" Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding AuthenticationProvider.CurrentUser.Contact.FullName}"></TextBlock> </StackPanel> </Grid> - <ListBox x:Name="DemoItemsListBox" Margin="0 16 0 16" SelectedIndex="0"> - <Button Command="{Binding HomeCommand}" Style="{DynamicResource MaterialDesignFlatButton}">Home</Button> - <ListBoxItem>Item 2</ListBoxItem> - <ListBoxItem>Item 3</ListBoxItem> - <ListBoxItem>Item 4</ListBoxItem> - <ListBoxItem>Item 5</ListBoxItem> + <StackPanel Margin="0 16 0 0"> + <ListBoxItem> + <i:Interaction.Triggers> + <i:EventTrigger EventName="PreviewMouseUp"> + <i:InvokeCommandAction Command="{Binding HomeCommand}"></i:InvokeCommandAction> + </i:EventTrigger> + </i:Interaction.Triggers> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon VerticalAlignment="Center" Kind="Home" Width="32" Height="32"></materialDesign:PackIcon> + <TextBlock FontSize="16" VerticalAlignment="Center" Margin="10 0 0 0">Home</TextBlock> + </StackPanel> + </ListBoxItem> + </StackPanel> + <ListBox ItemsSource="{Binding StudioModuleLoader.UserModules}" HorizontalContentAlignment="Stretch"> + <ListBox.ItemContainerStyle> + <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}"> + <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter> + <Setter Property="VerticalContentAlignment" Value="Stretch"></Setter> + </Style> + </ListBox.ItemContainerStyle> + <ListBox.ItemTemplate> + <DataTemplate> + <Grid Background="Transparent"> + <i:Interaction.Triggers> + <i:EventTrigger EventName="PreviewMouseUp"> + <i:InvokeCommandAction Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.StartModuleCommand}" CommandParameter="{Binding}"></i:InvokeCommandAction> + </i:EventTrigger> + </i:Interaction.Triggers> + + <TextBlock Text="{Binding Name}" ToolTip="{Binding Description}"></TextBlock> + </Grid> + </DataTemplate> + </ListBox.ItemTemplate> </ListBox> - </DockPanel> + </StackPanel> </materialDesign:DrawerHost.LeftDrawerContent> <DockPanel> <materialDesign:ColorZone Padding="16" materialDesign:ShadowAssist.ShadowDepth="Depth2" @@ -150,6 +192,47 @@ <ContentPresenter Content="{Binding CurrentModule.MainView}"></ContentPresenter> </Grid> </Grid> + + <Border HorizontalAlignment="Right" Margin="0 -1 10 0" VerticalAlignment="Top" Width="300" Height="40" Padding="5" CornerRadius="0 0 30 30" BorderThickness="1 0 1 1" BorderBrush="DimGray"> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="0"></ScaleTransform> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding NotificationProvider.HasTaskItems}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation BeginTime="00:00:01" Storyboard.TargetProperty="RenderTransform.ScaleY" To="0" From="1" Duration="00:00:0.5"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Border.Style> + <Border.Background> + <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> + <GradientStop Color="#03A9F4"/> + <GradientStop Color="#0081BB" Offset="1"/> + </LinearGradientBrush> + </Border.Background> + + <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="20 0 0 0"> + <mahapps:ProgressRing Width="24" Height="24" Foreground="White"></mahapps:ProgressRing> + <TextBlock Text="{Binding NotificationProvider.CurrentTaskItem.Message}" Foreground="White" VerticalAlignment="Center" Margin="10 0 0 0"></TextBlock> + </StackPanel> + </Border> </Grid> </DockPanel> </materialDesign:DrawerHost> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ShutdownView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ShutdownView.xaml index 20329ef25..487dfe1f8 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ShutdownView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ShutdownView.xaml @@ -3,10 +3,21 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" mc:Ignorable="d" - d:DesignHeight="300" d:DesignWidth="300" DataContext="{Binding ShutdownViewVM, Source={StaticResource Locator}}"> + d:DesignHeight="720" d:DesignWidth="1280" Cursor="Wait" Background="White" DataContext="{Binding ShutdownViewVM, Source={StaticResource Locator}}"> <Grid> - + <Grid HorizontalAlignment="Center" VerticalAlignment="Center"> + <StackPanel> + <Image Source="/Images/machine-trans.png" RenderOptions.BitmapScalingMode="Fant" Width="100"></Image> + <StackPanel Orientation="Horizontal"> + <TextBlock FontSize="70" Foreground="Gray">Machine Studio</TextBlock> + </StackPanel> + <TextBlock HorizontalAlignment="Right" FontSize="18" Margin="0 0 -50 0" Foreground="Gray">Twine Solutions</TextBlock> + <mahapps:ProgressRing Margin="20 60 20 40" Width="80" Height="80" Foreground="Gray"></mahapps:ProgressRing> + <TextBlock HorizontalAlignment="Center" FontSize="18" FontStyle="Italic" Foreground="Gray">Shutting Down, please wait...</TextBlock> + </StackPanel> + </Grid> </Grid> </UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/packages.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/packages.config index 2da000205..3a7265a72 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/packages.config +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/packages.config @@ -9,4 +9,5 @@ <package id="MaterialDesignThemes" version="2.3.1.953" targetFramework="net46" /> <package id="MvvmLight" version="5.3.0.0" targetFramework="net46" /> <package id="MvvmLightLibs" version="5.3.0.0" targetFramework="net46" /> + <package id="SimpleValidator" version="0.6.1.0" targetFramework="net46" /> </packages>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Class.cs b/Software/Visual_Studio/Tango.CodeGeneration/Class.cs index 087f07916..45a32ae3e 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Class.cs +++ b/Software/Visual_Studio/Tango.CodeGeneration/Class.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace Tango.CodeGeneration { - public class Class : CodeObject + public class Class : CodeObject { /// <summary> /// Gets or sets the class name. diff --git a/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFileJava.cs b/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFileJava.cs new file mode 100644 index 000000000..d2bfd80fc --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFileJava.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.CodeGeneration +{ + public class EntityCodeFileJava : Class + { + public String EntityName { get; set; } + + public String TableName { get; set; } + + public List<EntityCodeFileField> Fields { get; set; } + + public EntityCodeFileJava(String name) : base(name) + { + Fields = new List<EntityCodeFileField>(); + } + } +} diff --git a/Software/Visual_Studio/Tango.CodeGeneration/EnumerationFileJava.cs b/Software/Visual_Studio/Tango.CodeGeneration/EnumerationFileJava.cs new file mode 100644 index 000000000..6a42326f7 --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/EnumerationFileJava.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.CodeGeneration +{ + public class EnumerationFileJava : CodeFile + { + public String Name { get; set; } + + public List<EnumerationField> Fields { get; set; } + + public EnumerationFileJava() + { + Fields = new List<EnumerationField>(); + } + } +} diff --git a/Software/Visual_Studio/Tango.CodeGeneration/ObservablesAdapterFile.cs b/Software/Visual_Studio/Tango.CodeGeneration/ObservablesAdapterFile.cs new file mode 100644 index 000000000..7b1e3d8fe --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/ObservablesAdapterFile.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.CodeGeneration +{ + public class ObservablesAdapterFile : Class + { + + } +} diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj index e2cc941e7..1c491813a 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj +++ b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj @@ -64,8 +64,11 @@ <Compile Include="CodeFile.cs" /> <Compile Include="CodeObject.cs" /> <Compile Include="DpProperty.cs" /> + <Compile Include="EntityCodeFileJava.cs" /> <Compile Include="EntityCodeFile.cs" /> <Compile Include="EnumerationField.cs" /> + <Compile Include="TangoDAOJavaFile.cs" /> + <Compile Include="EnumerationFileJava.cs" /> <Compile Include="EnumerationFile.cs" /> <Compile Include="Helper.cs" /> <Compile Include="ICodeObject.cs" /> @@ -73,6 +76,7 @@ <Compile Include="CodeObjectModifier.cs" /> <Compile Include="MethodModifier.cs" /> <Compile Include="Namespace.cs" /> + <Compile Include="ObservablesAdapterFile.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Property.cs" /> </ItemGroup> @@ -96,6 +100,10 @@ <EmbeddedResource Include="Templates\Namespace.cshtml" /> <EmbeddedResource Include="Templates\EntityCodeFile.cshtml" /> <EmbeddedResource Include="Templates\EnumerationFile.cshtml" /> + <EmbeddedResource Include="Templates\ObservablesAdapterFile.cshtml" /> + <EmbeddedResource Include="Templates\EntityCodeFileJava.cshtml" /> + <EmbeddedResource Include="Templates\EnumerationFileJava.cshtml" /> + <EmbeddedResource Include="Templates\TangoDAOJavaFile.cshtml" /> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. diff --git a/Software/Visual_Studio/Tango.CodeGeneration/TangoDAOJavaFile.cs b/Software/Visual_Studio/Tango.CodeGeneration/TangoDAOJavaFile.cs new file mode 100644 index 000000000..5221365e4 --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/TangoDAOJavaFile.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.CodeGeneration +{ + public class TangoDAOJavaFile : CodeFile + { + public String Name { get; set; } + + public List<TangoDAOEntity> Entities { get; set; } + + public TangoDAOJavaFile() + { + Entities = new List<TangoDAOEntity>(); + } + + public class TangoDAOEntity + { + public String Name { get; set; } + public String TableName { get; set; } + } + } +} diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFileJava.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFileJava.cshtml new file mode 100644 index 000000000..aeba15b12 --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFileJava.cshtml @@ -0,0 +1,59 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Column; +import com.raizlabs.android.dbflow.annotation.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.Table; +import org.joda.time.DateTime; +import com.twine.tango.dal.Entity; +import com.twine.tango.dal.TangoDB; + + + @@Table(name = "@(Model.TableName)", database = TangoDB.class) + public class @(Model.Name) extends Entity + { + @foreach (var prop in Model.Fields) + { + if (!prop.Construct) + { + <div> + @@Column(name = "@(prop.FieldName)") + private @(prop.Type) @(prop.Description); + + </div> + } + else + { + <div> + @@ForeignKey(references = { @@ForeignKeyReference(columnName = "@(prop.FieldName)_GUID", foreignKeyColumnName = "GUID")}) + private @(prop.Type) @(prop.Description); + + </div> + } + } + + @foreach (var prop in Model.Fields) + { + <div> + /** + * Gets the @(prop.Name). + * + * return the @(prop.Name) + */ + public @(prop.Type) @(prop.Type == "Boolean" ? "is" + prop.Name : "get" + prop.Name)() + { + return @(prop.Description); + } + + /** + * Sets the @(prop.Name). + * + * @@param @(prop.Description) the @(prop.Name) + */ + public void set@(prop.Name)(@(prop.Type) @(prop.Description)) + { + this.@(prop.Description) = @(prop.Description); + } + </div> + } + } diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EnumerationFileJava.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EnumerationFileJava.cshtml new file mode 100644 index 000000000..435608204 --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EnumerationFileJava.cshtml @@ -0,0 +1,23 @@ +package com.twine.tango.dal.enumerations; + +import com.twine.tango.core.DescriptionAnnotation; + +public enum @(Model.Name) +{ + @foreach (var prop in Model.Fields) + { + <div> + @@DescriptionAnnotation(description = "@(prop.Description)") + @(prop.Name)(@(prop.Value)), + + </div> + } + ; + + private int value; + + @(Model.Name)(int value) + { + this.value = value; + } +} diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/ObservablesAdapterFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/ObservablesAdapterFile.cshtml new file mode 100644 index 000000000..856b8ac42 --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/ObservablesAdapterFile.cshtml @@ -0,0 +1,46 @@ +using System.Collections.ObjectModel; +using System.ComponentModel; + +namespace Tango.DAL.Observables +{ + public partial class @(Model.Name) + { + @foreach (var prop in Model.Properties) + { + <div> + private @(prop.Type) _@(prop.Name.ToLower()); + /// <summary> + /// Gets or sets the @(prop.Name). + /// </summary> + public @(prop.Type) @(prop.Name) + { + get { return _@(prop.Name.ToLower()); } + set { _@(prop.Name.ToLower()) = value; RaisePropertyChanged(nameof(@(prop.Name))); } + } + + private ICollectionView _@(prop.Name.ToLower())ViewSource; + /// <summary> + /// Gets or sets the @(prop.Name) View Source. + ///</summary> + public ICollectionView @(prop.Name)ViewSource + { + get { return _@(prop.Name.ToLower())ViewSource; } + set { _@(prop.Name.ToLower())ViewSource = value; RaisePropertyChanged(nameof(@(prop.Name)ViewSource)); } + } + </div> + } + + /// <summary> + /// Initialize collection sources. + /// </summary> + private void InitCollectionSources() + { + @foreach (var prop in Model.Properties) + { + <div> + @(prop.Name)ViewSource = CreateCollectionView(@(prop.Name)); + </div> + } + } + } +} diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/TangoDAOJavaFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/TangoDAOJavaFile.cshtml new file mode 100644 index 000000000..46bd6532c --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/TangoDAOJavaFile.cshtml @@ -0,0 +1,27 @@ +package com.twine.tango.dal.dao; + +import com.raizlabs.android.dbflow.sql.language.SQLite; +@foreach (var entity in Model.Entities) +{ + <div>import com.twine.tango.dal.entities.@(entity.Name);</div> +} +import java.util.List; + +public class TangoDAO +{ +@foreach (var entity in Model.Entities) +{ +<div> + /** + * Gets all the @(entity.TableName) from database. + * + * @@return all @(entity.TableName) + */ + public static List<@(entity.Name)> getAll@(entity.TableName)() + { + return SQLite.select().from(@(entity.Name).class).queryList(); + } + +</div> +} +} diff --git a/Software/Visual_Studio/Tango.ColorPicker/Chromes/Implementation/ButtonChrome.cs b/Software/Visual_Studio/Tango.ColorPicker/Chromes/Implementation/ButtonChrome.cs new file mode 100644 index 000000000..871ef2dc0 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/Chromes/Implementation/ButtonChrome.cs @@ -0,0 +1,272 @@ +/************************************************************************************* + + Extended WPF Toolkit + + Copyright (C) 2007-2013 Xceed Software Inc. + + This program is provided to you under the terms of the Microsoft Public + License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license + + For more features, controls, and fast professional support, + pick up the Plus Edition at http://xceed.com/wpf_toolkit + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + ***********************************************************************************/ + +using System; +using System.Windows; +using System.Windows.Controls; + +namespace Tango.ColorPicker +{ + internal class ButtonChrome : ContentControl + { + #region CornerRadius + + public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.Register( "CornerRadius", typeof( CornerRadius ), typeof( ButtonChrome ), new UIPropertyMetadata( default( CornerRadius ), new PropertyChangedCallback( OnCornerRadiusChanged ) ) ); + public CornerRadius CornerRadius + { + get + { + return ( CornerRadius )GetValue( CornerRadiusProperty ); + } + set + { + SetValue( CornerRadiusProperty, value ); + } + } + + private static void OnCornerRadiusChanged( DependencyObject o, DependencyPropertyChangedEventArgs e ) + { + ButtonChrome buttonChrome = o as ButtonChrome; + if( buttonChrome != null ) + buttonChrome.OnCornerRadiusChanged( ( CornerRadius )e.OldValue, ( CornerRadius )e.NewValue ); + } + + protected virtual void OnCornerRadiusChanged( CornerRadius oldValue, CornerRadius newValue ) + { + //we always want the InnerBorderRadius to be one less than the CornerRadius + CornerRadius newInnerCornerRadius = new CornerRadius( Math.Max( 0, newValue.TopLeft - 1 ), + Math.Max( 0, newValue.TopRight - 1 ), + Math.Max( 0, newValue.BottomRight - 1 ), + Math.Max( 0, newValue.BottomLeft - 1 ) ); + + InnerCornerRadius = newInnerCornerRadius; + } + + #endregion //CornerRadius + + #region InnerCornerRadius + + public static readonly DependencyProperty InnerCornerRadiusProperty = DependencyProperty.Register( "InnerCornerRadius", typeof( CornerRadius ), typeof( ButtonChrome ), new UIPropertyMetadata( default( CornerRadius ), new PropertyChangedCallback( OnInnerCornerRadiusChanged ) ) ); + public CornerRadius InnerCornerRadius + { + get + { + return ( CornerRadius )GetValue( InnerCornerRadiusProperty ); + } + set + { + SetValue( InnerCornerRadiusProperty, value ); + } + } + + private static void OnInnerCornerRadiusChanged( DependencyObject o, DependencyPropertyChangedEventArgs e ) + { + ButtonChrome buttonChrome = o as ButtonChrome; + if( buttonChrome != null ) + buttonChrome.OnInnerCornerRadiusChanged( ( CornerRadius )e.OldValue, ( CornerRadius )e.NewValue ); + } + + protected virtual void OnInnerCornerRadiusChanged( CornerRadius oldValue, CornerRadius newValue ) + { + // TODO: Add your property changed side-effects. Descendants can override as well. + } + + #endregion //InnerCornerRadius + + #region RenderChecked + + public static readonly DependencyProperty RenderCheckedProperty = DependencyProperty.Register( "RenderChecked", typeof( bool ), typeof( ButtonChrome ), new UIPropertyMetadata( false, OnRenderCheckedChanged ) ); + public bool RenderChecked + { + get + { + return ( bool )GetValue( RenderCheckedProperty ); + } + set + { + SetValue( RenderCheckedProperty, value ); + } + } + + private static void OnRenderCheckedChanged( DependencyObject o, DependencyPropertyChangedEventArgs e ) + { + ButtonChrome buttonChrome = o as ButtonChrome; + if( buttonChrome != null ) + buttonChrome.OnRenderCheckedChanged( ( bool )e.OldValue, ( bool )e.NewValue ); + } + + protected virtual void OnRenderCheckedChanged( bool oldValue, bool newValue ) + { + // TODO: Add your property changed side-effects. Descendants can override as well. + } + + #endregion //RenderChecked + + #region RenderEnabled + + public static readonly DependencyProperty RenderEnabledProperty = DependencyProperty.Register( "RenderEnabled", typeof( bool ), typeof( ButtonChrome ), new UIPropertyMetadata( true, OnRenderEnabledChanged ) ); + public bool RenderEnabled + { + get + { + return ( bool )GetValue( RenderEnabledProperty ); + } + set + { + SetValue( RenderEnabledProperty, value ); + } + } + + private static void OnRenderEnabledChanged( DependencyObject o, DependencyPropertyChangedEventArgs e ) + { + ButtonChrome buttonChrome = o as ButtonChrome; + if( buttonChrome != null ) + buttonChrome.OnRenderEnabledChanged( ( bool )e.OldValue, ( bool )e.NewValue ); + } + + protected virtual void OnRenderEnabledChanged( bool oldValue, bool newValue ) + { + // TODO: Add your property changed side-effects. Descendants can override as well. + } + + #endregion //RenderEnabled + + #region RenderFocused + + public static readonly DependencyProperty RenderFocusedProperty = DependencyProperty.Register( "RenderFocused", typeof( bool ), typeof( ButtonChrome ), new UIPropertyMetadata( false, OnRenderFocusedChanged ) ); + public bool RenderFocused + { + get + { + return ( bool )GetValue( RenderFocusedProperty ); + } + set + { + SetValue( RenderFocusedProperty, value ); + } + } + + private static void OnRenderFocusedChanged( DependencyObject o, DependencyPropertyChangedEventArgs e ) + { + ButtonChrome buttonChrome = o as ButtonChrome; + if( buttonChrome != null ) + buttonChrome.OnRenderFocusedChanged( ( bool )e.OldValue, ( bool )e.NewValue ); + } + + protected virtual void OnRenderFocusedChanged( bool oldValue, bool newValue ) + { + // TODO: Add your property changed side-effects. Descendants can override as well. + } + + #endregion //RenderFocused + + #region RenderMouseOver + + public static readonly DependencyProperty RenderMouseOverProperty = DependencyProperty.Register( "RenderMouseOver", typeof( bool ), typeof( ButtonChrome ), new UIPropertyMetadata( false, OnRenderMouseOverChanged ) ); + public bool RenderMouseOver + { + get + { + return ( bool )GetValue( RenderMouseOverProperty ); + } + set + { + SetValue( RenderMouseOverProperty, value ); + } + } + + private static void OnRenderMouseOverChanged( DependencyObject o, DependencyPropertyChangedEventArgs e ) + { + ButtonChrome buttonChrome = o as ButtonChrome; + if( buttonChrome != null ) + buttonChrome.OnRenderMouseOverChanged( ( bool )e.OldValue, ( bool )e.NewValue ); + } + + protected virtual void OnRenderMouseOverChanged( bool oldValue, bool newValue ) + { + // TODO: Add your property changed side-effects. Descendants can override as well. + } + + #endregion //RenderMouseOver + + #region RenderNormal + + public static readonly DependencyProperty RenderNormalProperty = DependencyProperty.Register( "RenderNormal", typeof( bool ), typeof( ButtonChrome ), new UIPropertyMetadata( true, OnRenderNormalChanged ) ); + public bool RenderNormal + { + get + { + return ( bool )GetValue( RenderNormalProperty ); + } + set + { + SetValue( RenderNormalProperty, value ); + } + } + + private static void OnRenderNormalChanged( DependencyObject o, DependencyPropertyChangedEventArgs e ) + { + ButtonChrome buttonChrome = o as ButtonChrome; + if( buttonChrome != null ) + buttonChrome.OnRenderNormalChanged( ( bool )e.OldValue, ( bool )e.NewValue ); + } + + protected virtual void OnRenderNormalChanged( bool oldValue, bool newValue ) + { + // TODO: Add your property changed side-effects. Descendants can override as well. + } + + #endregion //RenderNormal + + #region RenderPressed + + public static readonly DependencyProperty RenderPressedProperty = DependencyProperty.Register( "RenderPressed", typeof( bool ), typeof( ButtonChrome ), new UIPropertyMetadata( false, OnRenderPressedChanged ) ); + public bool RenderPressed + { + get + { + return ( bool )GetValue( RenderPressedProperty ); + } + set + { + SetValue( RenderPressedProperty, value ); + } + } + + private static void OnRenderPressedChanged( DependencyObject o, DependencyPropertyChangedEventArgs e ) + { + ButtonChrome buttonChrome = o as ButtonChrome; + if( buttonChrome != null ) + buttonChrome.OnRenderPressedChanged( ( bool )e.OldValue, ( bool )e.NewValue ); + } + + protected virtual void OnRenderPressedChanged( bool oldValue, bool newValue ) + { + // TODO: Add your property changed side-effects. Descendants can override as well. + } + + #endregion //RenderPressed + + #region Contsructors + + static ButtonChrome() + { + DefaultStyleKeyProperty.OverrideMetadata( typeof( ButtonChrome ), new FrameworkPropertyMetadata( typeof( ButtonChrome ) ) ); + } + + #endregion //Contsructors + } +} diff --git a/Software/Visual_Studio/Tango.ColorPicker/Chromes/Themes/Generic.xaml b/Software/Visual_Studio/Tango.ColorPicker/Chromes/Themes/Generic.xaml new file mode 100644 index 000000000..a6e259ca3 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/Chromes/Themes/Generic.xaml @@ -0,0 +1,228 @@ +<!--*********************************************************************************** + + Extended WPF Toolkit + + Copyright (C) 2007-2013 Xceed Software Inc. + + This program is provided to you under the terms of the Microsoft Public + License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license + + For more features, controls, and fast professional support, + pick up the Plus Edition at http://xceed.com/wpf_toolkit + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + **********************************************************************************--> + +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:chrome="clr-namespace:Tango.ColorPicker" + xmlns:themes="clr-namespace:Tango.ColorPicker.Themes"> + + <!-- =============================================================================== --> + <!-- ButtonChrome --> + <!-- =============================================================================== --> + + <Style TargetType="{x:Type chrome:ButtonChrome}"> + <Setter Property="IsTabStop" Value="False" /> + <Setter Property="SnapsToDevicePixels" Value="True" /> + <Setter Property="FocusVisualStyle" Value="{x:Null}" /> + <Setter Property="Background" Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonNormalBackgroundKey}}" /> + <Setter Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonNormalOuterBorderKey}}" /> + <Setter Property="BorderThickness" Value="1" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type chrome:ButtonChrome}"> + <Grid> + + <Border x:Name="OuterBorder" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"> + <Border x:Name="InnerBorder" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding InnerCornerRadius}" BorderBrush="{DynamicResource {x:Static themes:ResourceKeys.ButtonNormalInnerBorderKey}}" /> + </Border> + + <Border x:Name="MouseOverVisual" Opacity="0" Visibility="Collapsed" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" BorderBrush="{DynamicResource {x:Static themes:ResourceKeys.ButtonMouseOverOuterBorderKey}}" Background="{DynamicResource {x:Static themes:ResourceKeys.ButtonMouseOverBackgroundKey}}"> + <Border x:Name="MouseOverInnerVisual" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding InnerCornerRadius}" BorderBrush="{DynamicResource {x:Static themes:ResourceKeys.ButtonMouseOverInnerBorderKey}}" /> + </Border> + <Border x:Name="PressedVisual" Opacity="0" Visibility="Collapsed" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" BorderBrush="{DynamicResource {x:Static themes:ResourceKeys.ButtonPressedOuterBorderKey}}" Background="{DynamicResource {x:Static themes:ResourceKeys.ButtonPressedBackgroundKey}}"> + <Border x:Name="PressedInnerVisual" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding InnerCornerRadius}" BorderBrush="{DynamicResource {x:Static themes:ResourceKeys.ButtonPressedInnerBorderKey}}" /> + </Border> + + <Border x:Name="FocusVisual" Opacity="0" Visibility="Collapsed" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" BorderBrush="{DynamicResource {x:Static themes:ResourceKeys.ButtonFocusedOuterBorderKey}}" Background="{DynamicResource {x:Static themes:ResourceKeys.ButtonFocusedBackgroundKey}}"> + <Border x:Name="FocusInnerVisual" BorderThickness="1" CornerRadius="{TemplateBinding InnerCornerRadius}" BorderBrush="{DynamicResource {x:Static themes:ResourceKeys.ButtonFocusedInnerBorderKey}}" /> + </Border> + + <ContentPresenter Margin="{TemplateBinding Padding}" + IsEnabled="{TemplateBinding IsEnabled}" + Content="{TemplateBinding Content}" + ContentStringFormat="{TemplateBinding ContentStringFormat}" + ContentTemplate="{TemplateBinding ContentTemplate}" + ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" /> + + </Grid> + <ControlTemplate.Triggers> + + <!-- If button is disabled, not checked, and is rendered normal --> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="RenderEnabled" Value="False" /> + <Condition Property="RenderChecked" Value="False" /> + </MultiTrigger.Conditions> + <Setter TargetName="OuterBorder" Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonDisabledOuterBorderKey}}" /> + <Setter TargetName="InnerBorder" Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonInnerBorderDisabledKey}}" /> + <Setter TargetName="OuterBorder" Property="Background" Value="{DynamicResource {x:Static themes:ResourceKeys.ControlDisabledBackgroundKey}}" /> + </MultiTrigger> + + <!-- if button is enabled and pressed --> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="RenderEnabled" Value="True" /> + <Condition Property="RenderPressed" Value="True" /> + </MultiTrigger.Conditions> + <MultiTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PressedVisual" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="00:00:00"> + <DiscreteObjectKeyFrame.Value> + <Visibility>Visible</Visibility> + </DiscreteObjectKeyFrame.Value> + </DiscreteObjectKeyFrame> + </ObjectAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PressedVisual" Storyboard.TargetProperty="Opacity"> + <LinearDoubleKeyFrame KeyTime="00:00:00.050" Value="1" /> + </DoubleAnimationUsingKeyFrames> + </Storyboard> + </BeginStoryboard> + </MultiTrigger.EnterActions> + <MultiTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PressedVisual" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="00:00:00.115"> + <DiscreteObjectKeyFrame.Value> + <Visibility>Collapsed</Visibility> + </DiscreteObjectKeyFrame.Value> + </DiscreteObjectKeyFrame> + </ObjectAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PressedVisual" Storyboard.TargetProperty="Opacity"> + <LinearDoubleKeyFrame KeyTime="00:00:00.115" Value="0" /> + </DoubleAnimationUsingKeyFrames> + </Storyboard> + </BeginStoryboard> + </MultiTrigger.ExitActions> + </MultiTrigger> + + <!-- if button is enabled, is not checked, the mouse is over, and not pressed --> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="RenderEnabled" Value="True" /> + <Condition Property="RenderChecked" Value="False" /> + <Condition Property="RenderMouseOver" Value="True" /> + <Condition Property="RenderPressed" Value="False" /> + </MultiTrigger.Conditions> + <MultiTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MouseOverVisual" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="00:00:00"> + <DiscreteObjectKeyFrame.Value> + <Visibility>Visible</Visibility> + </DiscreteObjectKeyFrame.Value> + </DiscreteObjectKeyFrame> + </ObjectAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverVisual" Storyboard.TargetProperty="Opacity"> + <LinearDoubleKeyFrame KeyTime="00:00:00.115" Value="1" /> + </DoubleAnimationUsingKeyFrames> + </Storyboard> + </BeginStoryboard> + </MultiTrigger.EnterActions> + <MultiTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MouseOverVisual" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="00:00:00.150"> + <DiscreteObjectKeyFrame.Value> + <Visibility>Collapsed</Visibility> + </DiscreteObjectKeyFrame.Value> + </DiscreteObjectKeyFrame> + </ObjectAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverVisual" Storyboard.TargetProperty="Opacity"> + <LinearDoubleKeyFrame KeyTime="00:00:00.150" Value="0" /> + </DoubleAnimationUsingKeyFrames> + </Storyboard> + </BeginStoryboard> + </MultiTrigger.ExitActions> + </MultiTrigger> + + <!-- if button is enabled, checked, he mouse is not over, and it is not pressed --> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="RenderEnabled" Value="True" /> + <Condition Property="RenderChecked" Value="True" /> + <Condition Property="RenderMouseOver" Value="False" /> + <Condition Property="RenderPressed" Value="False" /> + </MultiTrigger.Conditions> + <Setter TargetName="OuterBorder" Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonPressedOuterBorderKey}}" /> + <Setter TargetName="InnerBorder" Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonPressedInnerBorderKey}}" /> + <Setter TargetName="OuterBorder" Property="Background" Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonPressedBackgroundKey}}" /> + </MultiTrigger> + + <!-- if button is focused, is enabled, not pressed, and the mouse is not over --> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="RenderFocused" Value="True" /> + <Condition Property="RenderEnabled" Value="True" /> + <Condition Property="RenderPressed" Value="False" /> + <Condition Property="RenderMouseOver" Value="False" /> + </MultiTrigger.Conditions> + <MultiTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="00:00:00"> + <DiscreteObjectKeyFrame.Value> + <Visibility>Visible</Visibility> + </DiscreteObjectKeyFrame.Value> + </DiscreteObjectKeyFrame> + </ObjectAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity"> + <LinearDoubleKeyFrame KeyTime="00:00:00.25" Value="1" /> + </DoubleAnimationUsingKeyFrames> + </Storyboard> + </BeginStoryboard> + </MultiTrigger.EnterActions> + <MultiTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="00:00:00.115"> + <DiscreteObjectKeyFrame.Value> + <Visibility>Collapsed</Visibility> + </DiscreteObjectKeyFrame.Value> + </DiscreteObjectKeyFrame> + </ObjectAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity"> + <LinearDoubleKeyFrame KeyTime="00:00:00.115" Value="0" /> + </DoubleAnimationUsingKeyFrames> + </Storyboard> + </BeginStoryboard> + </MultiTrigger.ExitActions> + </MultiTrigger> + + <!-- if not rendered normally --> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="RenderNormal" Value="False" /> + <Condition Property="RenderChecked" Value="False" /> + </MultiTrigger.Conditions> + <Setter TargetName="OuterBorder" Property="BorderBrush" Value="Transparent" /> + <Setter TargetName="InnerBorder" Property="BorderBrush" Value="{x:Null}" /> + <Setter TargetName="OuterBorder" Property="Background" Value="Transparent" /> + </MultiTrigger> + + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + +</ResourceDictionary> diff --git a/Software/Visual_Studio/Tango.ColorPicker/ColorBlendConverter.cs b/Software/Visual_Studio/Tango.ColorPicker/ColorBlendConverter.cs new file mode 100644 index 000000000..3e61fea36 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/ColorBlendConverter.cs @@ -0,0 +1,82 @@ +/************************************************************************************* + + Extended WPF Toolkit + + Copyright (C) 2007-2013 Xceed Software Inc. + + This program is provided to you under the terms of the Microsoft Public + License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license + + For more features, controls, and fast professional support, + pick up the Plus Edition at http://xceed.com/wpf_toolkit + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + ***********************************************************************************/ + +using System; +using System.Windows.Data; +using System.Windows.Media; + +namespace Tango.ColorPicker.Core.Converters +{ + /// <summary> + /// This converter allow to blend two colors into one based on a specified ratio + /// </summary> + internal class ColorBlendConverter : IValueConverter + { + private double _blendedColorRatio = 0; + + /// <summary> + /// The ratio of the blended color. Must be between 0 and 1. + /// </summary> + public double BlendedColorRatio + { + get { return _blendedColorRatio; } + + set + { + if (value < 0d || value > 1d) + throw new ArgumentException("BlendedColorRatio must greater than or equal to 0 and lower than or equal to 1 "); + + _blendedColorRatio = value; + } + } + + /// <summary> + /// The color to blend with the source color + /// </summary> + public Color BlendedColor { get; set; } + + public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + if (value == null || value.GetType() != typeof(Color)) + return null; + + Color color = (Color)value; + return new Color() + { + A = this.BlendValue(color.A, this.BlendedColor.A), + R = this.BlendValue(color.R, this.BlendedColor.R), + G = this.BlendValue(color.G, this.BlendedColor.G), + B = this.BlendValue(color.B, this.BlendedColor.B) + }; + } + + private byte BlendValue(byte original, byte blend) + { + double blendRatio = this.BlendedColorRatio; + double sourceRatio = 1 - blendRatio; + + double result = (((double)original) * sourceRatio) + (((double)blend) * blendRatio); + result = Math.Round(result); + result = Math.Min(255d, Math.Max(0d, result)); + return System.Convert.ToByte(result); + } + + public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/Tango.ColorPicker/ColorCanvas/Implementation/ColorCanvas.cs b/Software/Visual_Studio/Tango.ColorPicker/ColorCanvas/Implementation/ColorCanvas.cs new file mode 100644 index 000000000..da7176f61 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/ColorCanvas/Implementation/ColorCanvas.cs @@ -0,0 +1,602 @@ +/************************************************************************************* + + Extended WPF Toolkit + + Copyright (C) 2007-2013 Xceed Software Inc. + + This program is provided to you under the terms of the Microsoft Public + License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license + + For more features, controls, and fast professional support, + pick up the Plus Edition at http://xceed.com/wpf_toolkit + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + ***********************************************************************************/ + +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Input; +using System.Windows.Media; +using Tango.ColorPicker.Core.Utilities; +using Tango.ColorPicker.Primitives; +using System.IO; +using System; + +namespace Tango +{ + [TemplatePart( Name = PART_ColorShadingCanvas, Type = typeof( Canvas ) )] + [TemplatePart( Name = PART_ColorShadeSelector, Type = typeof( Canvas ) )] + [TemplatePart( Name = PART_SpectrumSlider, Type = typeof( ColorSpectrumSlider ) )] + [TemplatePart( Name = PART_HexadecimalTextBox, Type = typeof( TextBox ) )] + internal class ColorCanvas : Control + { + private const string PART_ColorShadingCanvas = "PART_ColorShadingCanvas"; + private const string PART_ColorShadeSelector = "PART_ColorShadeSelector"; + private const string PART_SpectrumSlider = "PART_SpectrumSlider"; + private const string PART_HexadecimalTextBox = "PART_HexadecimalTextBox"; + + #region Private Members + + private TranslateTransform _colorShadeSelectorTransform = new TranslateTransform(); + private Canvas _colorShadingCanvas; + private Canvas _colorShadeSelector; + private ColorSpectrumSlider _spectrumSlider; + private TextBox _hexadecimalTextBox; + private Point? _currentColorPosition; + private bool _surpressPropertyChanged; + private bool _updateSpectrumSliderValue = true; + + #endregion //Private Members + + #region Properties + + #region SelectedColor + + public static readonly DependencyProperty SelectedColorProperty = DependencyProperty.Register( "SelectedColor", typeof( Color? ), typeof( ColorCanvas ), new FrameworkPropertyMetadata( null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSelectedColorChanged ) ); + public Color? SelectedColor + { + get + { + return ( Color? )GetValue( SelectedColorProperty ); + } + set + { + SetValue( SelectedColorProperty, value ); + } + } + + private static void OnSelectedColorChanged( DependencyObject o, DependencyPropertyChangedEventArgs e ) + { + ColorCanvas colorCanvas = o as ColorCanvas; + if( colorCanvas != null ) + colorCanvas.OnSelectedColorChanged( ( Color? )e.OldValue, ( Color? )e.NewValue ); + } + + protected virtual void OnSelectedColorChanged( Color? oldValue, Color? newValue ) + { + SetHexadecimalStringProperty( GetFormatedColorString( newValue ), false ); + UpdateRGBValues( newValue ); + UpdateColorShadeSelectorPosition( newValue ); + + RoutedPropertyChangedEventArgs<Color?> args = new RoutedPropertyChangedEventArgs<Color?>( oldValue, newValue ); + args.RoutedEvent = SelectedColorChangedEvent; + RaiseEvent( args ); + } + + #endregion //SelectedColor + + #region RGB + + #region A + + public static readonly DependencyProperty AProperty = DependencyProperty.Register( "A", typeof( byte ), typeof( ColorCanvas ), new UIPropertyMetadata( ( byte )255, OnAChanged ) ); + public byte A + { + get + { + return ( byte )GetValue( AProperty ); + } + set + { + SetValue( AProperty, value ); + } + } + + private static void OnAChanged( DependencyObject o, DependencyPropertyChangedEventArgs e ) + { + ColorCanvas colorCanvas = o as ColorCanvas; + if( colorCanvas != null ) + colorCanvas.OnAChanged( ( byte )e.OldValue, ( byte )e.NewValue ); + } + + protected virtual void OnAChanged( byte oldValue, byte newValue ) + { + if( !_surpressPropertyChanged ) + UpdateSelectedColor(); + } + + #endregion //A + + #region R + + public static readonly DependencyProperty RProperty = DependencyProperty.Register( "R", typeof( byte ), typeof( ColorCanvas ), new UIPropertyMetadata( ( byte )0, OnRChanged ) ); + public byte R + { + get + { + return ( byte )GetValue( RProperty ); + } + set + { + SetValue( RProperty, value ); + } + } + + private static void OnRChanged( DependencyObject o, DependencyPropertyChangedEventArgs e ) + { + ColorCanvas colorCanvas = o as ColorCanvas; + if( colorCanvas != null ) + colorCanvas.OnRChanged( ( byte )e.OldValue, ( byte )e.NewValue ); + } + + protected virtual void OnRChanged( byte oldValue, byte newValue ) + { + if( !_surpressPropertyChanged ) + UpdateSelectedColor(); + } + + #endregion //R + + #region G + + public static readonly DependencyProperty GProperty = DependencyProperty.Register( "G", typeof( byte ), typeof( ColorCanvas ), new UIPropertyMetadata( ( byte )0, OnGChanged ) ); + public byte G + { + get + { + return ( byte )GetValue( GProperty ); + } + set + { + SetValue( GProperty, value ); + } + } + + private static void OnGChanged( DependencyObject o, DependencyPropertyChangedEventArgs e ) + { + ColorCanvas colorCanvas = o as ColorCanvas; + if( colorCanvas != null ) + colorCanvas.OnGChanged( ( byte )e.OldValue, ( byte )e.NewValue ); + } + + protected virtual void OnGChanged( byte oldValue, byte newValue ) + { + if( !_surpressPropertyChanged ) + UpdateSelectedColor(); + } + + #endregion //G + + #region B + + public static readonly DependencyProperty BProperty = DependencyProperty.Register( "B", typeof( byte ), typeof( ColorCanvas ), new UIPropertyMetadata( ( byte )0, OnBChanged ) ); + public byte B + { + get + { + return ( byte )GetValue( BProperty ); + } + set + { + SetValue( BProperty, value ); + } + } + + private static void OnBChanged( DependencyObject o, DependencyPropertyChangedEventArgs e ) + { + ColorCanvas colorCanvas = o as ColorCanvas; + if( colorCanvas != null ) + colorCanvas.OnBChanged( ( byte )e.OldValue, ( byte )e.NewValue ); + } + + protected virtual void OnBChanged( byte oldValue, byte newValue ) + { + if( !_surpressPropertyChanged ) + UpdateSelectedColor(); + } + + #endregion //B + + #endregion //RGB + + #region HexadecimalString + + public static readonly DependencyProperty HexadecimalStringProperty = DependencyProperty.Register( "HexadecimalString", typeof( string ), typeof( ColorCanvas ), new UIPropertyMetadata( "", OnHexadecimalStringChanged, OnCoerceHexadecimalString ) ); + public string HexadecimalString + { + get + { + return ( string )GetValue( HexadecimalStringProperty ); + } + set + { + SetValue( HexadecimalStringProperty, value ); + } + } + + private static void OnHexadecimalStringChanged( DependencyObject o, DependencyPropertyChangedEventArgs e ) + { + ColorCanvas colorCanvas = o as ColorCanvas; + if( colorCanvas != null ) + colorCanvas.OnHexadecimalStringChanged( ( string )e.OldValue, ( string )e.NewValue ); + } + + protected virtual void OnHexadecimalStringChanged( string oldValue, string newValue ) + { + string newColorString = GetFormatedColorString( newValue ); + string currentColorString = GetFormatedColorString( SelectedColor ); + if( !currentColorString.Equals( newColorString ) ) + { + Color? col = null; + if( !string.IsNullOrEmpty( newColorString ) ) + { + col = ( Color )ColorConverter.ConvertFromString( newColorString ); + } + UpdateSelectedColor( col ); + } + + SetHexadecimalTextBoxTextProperty( newValue ); + } + + private static object OnCoerceHexadecimalString( DependencyObject d, object basevalue ) + { + var colorCanvas = ( ColorCanvas )d; + if( colorCanvas == null ) + return basevalue; + + return colorCanvas.OnCoerceHexadecimalString( basevalue ); + } + + private object OnCoerceHexadecimalString( object newValue ) + { + var value = newValue as string; + string retValue = value; + + try + { + if( !string.IsNullOrEmpty( retValue ) ) + { + ColorConverter.ConvertFromString( value ); + } + } + catch + { + //When HexadecimalString is changed via Code-Behind and hexadecimal format is bad, throw. + throw new InvalidDataException( "Color provided is not in the correct format." ); + } + + return retValue; + } + + #endregion //HexadecimalString + + #region UsingAlphaChannel + + public static readonly DependencyProperty UsingAlphaChannelProperty = DependencyProperty.Register( "UsingAlphaChannel", typeof( bool ), typeof( ColorCanvas ), new FrameworkPropertyMetadata( true, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback( OnUsingAlphaChannelPropertyChanged ) ) ); + public bool UsingAlphaChannel + { + get + { + return ( bool )GetValue( UsingAlphaChannelProperty ); + } + set + { + SetValue( UsingAlphaChannelProperty, value ); + } + } + + private static void OnUsingAlphaChannelPropertyChanged( DependencyObject o, DependencyPropertyChangedEventArgs e ) + { + ColorCanvas colorCanvas = o as ColorCanvas; + if( colorCanvas != null ) + colorCanvas.OnUsingAlphaChannelChanged(); + } + + protected virtual void OnUsingAlphaChannelChanged() + { + SetHexadecimalStringProperty( GetFormatedColorString( SelectedColor ), false ); + } + + #endregion //UsingAlphaChannel + + #endregion //Properties + + #region Constructors + + static ColorCanvas() + { + DefaultStyleKeyProperty.OverrideMetadata( typeof( ColorCanvas ), new FrameworkPropertyMetadata( typeof( ColorCanvas ) ) ); + } + + #endregion //Constructors + + #region Base Class Overrides + + public override void OnApplyTemplate() + { + base.OnApplyTemplate(); + + if( _colorShadingCanvas != null ) + { + _colorShadingCanvas.MouseLeftButtonDown -= ColorShadingCanvas_MouseLeftButtonDown; + _colorShadingCanvas.MouseLeftButtonUp -= ColorShadingCanvas_MouseLeftButtonUp; + _colorShadingCanvas.MouseMove -= ColorShadingCanvas_MouseMove; + _colorShadingCanvas.SizeChanged -= ColorShadingCanvas_SizeChanged; + } + + _colorShadingCanvas = GetTemplateChild( PART_ColorShadingCanvas ) as Canvas; + + if( _colorShadingCanvas != null ) + { + _colorShadingCanvas.MouseLeftButtonDown += ColorShadingCanvas_MouseLeftButtonDown; + _colorShadingCanvas.MouseLeftButtonUp += ColorShadingCanvas_MouseLeftButtonUp; + _colorShadingCanvas.MouseMove += ColorShadingCanvas_MouseMove; + _colorShadingCanvas.SizeChanged += ColorShadingCanvas_SizeChanged; + } + + _colorShadeSelector = GetTemplateChild( PART_ColorShadeSelector ) as Canvas; + + if( _colorShadeSelector != null ) + _colorShadeSelector.RenderTransform = _colorShadeSelectorTransform; + + if( _spectrumSlider != null ) + _spectrumSlider.ValueChanged -= SpectrumSlider_ValueChanged; + + _spectrumSlider = GetTemplateChild( PART_SpectrumSlider ) as ColorSpectrumSlider; + + if( _spectrumSlider != null ) + _spectrumSlider.ValueChanged += SpectrumSlider_ValueChanged; + + if( _hexadecimalTextBox != null ) + _hexadecimalTextBox.LostFocus -= new RoutedEventHandler( HexadecimalTextBox_LostFocus ); + + _hexadecimalTextBox = GetTemplateChild( PART_HexadecimalTextBox ) as TextBox; + + if( _hexadecimalTextBox != null ) + _hexadecimalTextBox.LostFocus += new RoutedEventHandler( HexadecimalTextBox_LostFocus ); + + UpdateRGBValues( SelectedColor ); + UpdateColorShadeSelectorPosition( SelectedColor ); + + // When changing theme, HexadecimalString needs to be set since it is not binded. + SetHexadecimalTextBoxTextProperty( GetFormatedColorString( SelectedColor ) ); + } + + protected override void OnKeyDown( KeyEventArgs e ) + { + base.OnKeyDown( e ); + + //hitting enter on textbox will update Hexadecimal string + if( e.Key == Key.Enter && e.OriginalSource is TextBox ) + { + TextBox textBox = ( TextBox )e.OriginalSource; + if( textBox.Name == PART_HexadecimalTextBox ) + SetHexadecimalStringProperty( textBox.Text, true ); + } + } + + #endregion //Base Class Overrides + + #region Event Handlers + + void ColorShadingCanvas_MouseLeftButtonDown( object sender, MouseButtonEventArgs e ) + { + Point p = e.GetPosition( _colorShadingCanvas ); + UpdateColorShadeSelectorPositionAndCalculateColor( p, true ); + _colorShadingCanvas.CaptureMouse(); + //Prevent from closing ColorCanvas after mouseDown in ListView + e.Handled = true; + } + + void ColorShadingCanvas_MouseLeftButtonUp( object sender, MouseButtonEventArgs e ) + { + _colorShadingCanvas.ReleaseMouseCapture(); + } + + void ColorShadingCanvas_MouseMove( object sender, MouseEventArgs e ) + { + if( e.LeftButton == MouseButtonState.Pressed ) + { + Point p = e.GetPosition( _colorShadingCanvas ); + UpdateColorShadeSelectorPositionAndCalculateColor( p, true ); + Mouse.Synchronize(); + } + } + + void ColorShadingCanvas_SizeChanged( object sender, SizeChangedEventArgs e ) + { + if( _currentColorPosition != null ) + { + Point _newPoint = new Point + { + X = ( ( Point )_currentColorPosition ).X * e.NewSize.Width, + Y = ( ( Point )_currentColorPosition ).Y * e.NewSize.Height + }; + + UpdateColorShadeSelectorPositionAndCalculateColor( _newPoint, false ); + } + } + + void SpectrumSlider_ValueChanged( object sender, RoutedPropertyChangedEventArgs<double> e ) + { + if( (_currentColorPosition != null) && (this.SelectedColor != null) ) + { + CalculateColor( ( Point )_currentColorPosition ); + } + } + + void HexadecimalTextBox_LostFocus( object sender, RoutedEventArgs e ) + { + TextBox textbox = sender as TextBox; + SetHexadecimalStringProperty( textbox.Text, true ); + } + + #endregion //Event Handlers + + #region Events + + public static readonly RoutedEvent SelectedColorChangedEvent = EventManager.RegisterRoutedEvent( "SelectedColorChanged", RoutingStrategy.Bubble, typeof( RoutedPropertyChangedEventHandler<Color?> ), typeof( ColorCanvas ) ); + public event RoutedPropertyChangedEventHandler<Color?> SelectedColorChanged + { + add + { + AddHandler( SelectedColorChangedEvent, value ); + } + remove + { + RemoveHandler( SelectedColorChangedEvent, value ); + } + } + + #endregion //Events + + #region Methods + + private void UpdateSelectedColor() + { + SelectedColor = Color.FromArgb( A, R, G, B ); + } + + private void UpdateSelectedColor( Color? color ) + { + SelectedColor = ( ( color != null ) && color.HasValue ) + ? (Color?)Color.FromArgb( color.Value.A, color.Value.R, color.Value.G, color.Value.B ) + : null; + } + + private void UpdateRGBValues( Color? color ) + { + if( ( color == null ) || !color.HasValue ) + return; + + _surpressPropertyChanged = true; + + A = color.Value.A; + R = color.Value.R; + G = color.Value.G; + B = color.Value.B; + + _surpressPropertyChanged = false; + } + + private void UpdateColorShadeSelectorPositionAndCalculateColor( Point p, bool calculateColor ) + { + if( p.Y < 0 ) + p.Y = 0; + + if( p.X < 0 ) + p.X = 0; + + if( p.X > _colorShadingCanvas.ActualWidth ) + p.X = _colorShadingCanvas.ActualWidth; + + if( p.Y > _colorShadingCanvas.ActualHeight ) + p.Y = _colorShadingCanvas.ActualHeight; + + _colorShadeSelectorTransform.X = p.X - ( _colorShadeSelector.Width / 2 ); + _colorShadeSelectorTransform.Y = p.Y - ( _colorShadeSelector.Height / 2 ); + + p.X = p.X / _colorShadingCanvas.ActualWidth; + p.Y = p.Y / _colorShadingCanvas.ActualHeight; + + _currentColorPosition = p; + + if( calculateColor ) + CalculateColor( p ); + } + + private void UpdateColorShadeSelectorPosition( Color? color ) + { + if( (_spectrumSlider == null) || (_colorShadingCanvas == null) || (color == null) || !color.HasValue) + return; + + _currentColorPosition = null; + + HsvColor hsv = ColorUtilities.ConvertRgbToHsv( color.Value.R, color.Value.G, color.Value.B ); + + if( _updateSpectrumSliderValue ) + { + _spectrumSlider.Value = hsv.H; + } + + Point p = new Point( hsv.S, 1 - hsv.V ); + + _currentColorPosition = p; + + _colorShadeSelectorTransform.X = ( p.X * _colorShadingCanvas.Width ) - 5; + _colorShadeSelectorTransform.Y = ( p.Y * _colorShadingCanvas.Height ) - 5; + } + + private void CalculateColor( Point p ) + { + HsvColor hsv = new HsvColor( 360 - _spectrumSlider.Value, 1, 1 ) + { + S = p.X, + V = 1 - p.Y + }; + var currentColor = ColorUtilities.ConvertHsvToRgb( hsv.H, hsv.S, hsv.V ); + currentColor.A = A; + _updateSpectrumSliderValue = false; + SelectedColor = currentColor; + _updateSpectrumSliderValue = true; + SetHexadecimalStringProperty( GetFormatedColorString( SelectedColor ), false ); + } + + private string GetFormatedColorString( Color? colorToFormat ) + { + if( ( colorToFormat == null ) || !colorToFormat.HasValue ) + return string.Empty; + return ColorUtilities.FormatColorString( colorToFormat.ToString(), UsingAlphaChannel ); + } + + private string GetFormatedColorString( string stringToFormat ) + { + return ColorUtilities.FormatColorString( stringToFormat, UsingAlphaChannel ); + } + + private void SetHexadecimalStringProperty( string newValue, bool modifyFromUI ) + { + if( modifyFromUI ) + { + try + { + if( !string.IsNullOrEmpty( newValue ) ) + { + ColorConverter.ConvertFromString( newValue ); + } + HexadecimalString = newValue; + } + catch + { + //When HexadecimalString is changed via UI and hexadecimal format is bad, keep the previous HexadecimalString. + SetHexadecimalTextBoxTextProperty( HexadecimalString ); + } + } + else + { + //When HexadecimalString is changed via Code-Behind, hexadecimal format will be evaluated in OnCoerceHexadecimalString() + HexadecimalString = newValue; + } + } + + private void SetHexadecimalTextBoxTextProperty( string newValue ) + { + if( _hexadecimalTextBox != null ) + _hexadecimalTextBox.Text = newValue; + } + + #endregion //Methods + } +} diff --git a/Software/Visual_Studio/Tango.ColorPicker/ColorCanvas/Implementation/ColorSpectrumSlider.cs b/Software/Visual_Studio/Tango.ColorPicker/ColorCanvas/Implementation/ColorSpectrumSlider.cs new file mode 100644 index 000000000..06233ba35 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/ColorCanvas/Implementation/ColorSpectrumSlider.cs @@ -0,0 +1,111 @@ +/************************************************************************************* + + Extended WPF Toolkit + + Copyright (C) 2007-2013 Xceed Software Inc. + + This program is provided to you under the terms of the Microsoft Public + License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license + + For more features, controls, and fast professional support, + pick up the Plus Edition at http://xceed.com/wpf_toolkit + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + ***********************************************************************************/ + +using System; +using System.Collections.Generic; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Media; +using System.Windows.Shapes; +using Tango.ColorPicker.Core.Utilities; + +namespace Tango +{ + [TemplatePart( Name = PART_SpectrumDisplay, Type = typeof( Rectangle ) )] + internal class ColorSpectrumSlider : Slider + { + private const string PART_SpectrumDisplay = "PART_SpectrumDisplay"; + + #region Private Members + + private Rectangle _spectrumDisplay; + private LinearGradientBrush _pickerBrush; + + #endregion //Private Members + + #region Constructors + + static ColorSpectrumSlider() + { + DefaultStyleKeyProperty.OverrideMetadata( typeof( ColorSpectrumSlider ), new FrameworkPropertyMetadata( typeof( ColorSpectrumSlider ) ) ); + } + + #endregion //Constructors + + #region Dependency Properties + + public static readonly DependencyProperty SelectedColorProperty = DependencyProperty.Register( "SelectedColor", typeof( Color ), typeof( ColorSpectrumSlider ), new PropertyMetadata( System.Windows.Media.Colors.Transparent ) ); + public Color SelectedColor + { + get + { + return ( Color )GetValue( SelectedColorProperty ); + } + set + { + SetValue( SelectedColorProperty, value ); + } + } + + #endregion //Dependency Properties + + #region Base Class Overrides + + public override void OnApplyTemplate() + { + base.OnApplyTemplate(); + + _spectrumDisplay = ( Rectangle )GetTemplateChild( PART_SpectrumDisplay ); + CreateSpectrum(); + OnValueChanged( Double.NaN, Value ); + } + + protected override void OnValueChanged( double oldValue, double newValue ) + { + base.OnValueChanged( oldValue, newValue ); + + Color color = ColorUtilities.ConvertHsvToRgb( 360 - newValue, 1, 1 ); + SelectedColor = color; + } + + #endregion //Base Class Overrides + + #region Methods + + private void CreateSpectrum() + { + _pickerBrush = new LinearGradientBrush(); + _pickerBrush.StartPoint = new Point( 0.5, 0 ); + _pickerBrush.EndPoint = new Point( 0.5, 1 ); + _pickerBrush.ColorInterpolationMode = ColorInterpolationMode.SRgbLinearInterpolation; + + List<Color> colorsList = ColorUtilities.GenerateHsvSpectrum(); + + double stopIncrement = ( double )1 / colorsList.Count; + + int i; + for( i = 0; i < colorsList.Count; i++ ) + { + _pickerBrush.GradientStops.Add( new GradientStop( colorsList[ i ], i * stopIncrement ) ); + } + + _pickerBrush.GradientStops[ i - 1 ].Offset = 1.0; + _spectrumDisplay.Fill = _pickerBrush; + } + + #endregion //Methods + } +} diff --git a/Software/Visual_Studio/Tango.ColorPicker/ColorCanvas/Themes/Generic.xaml b/Software/Visual_Studio/Tango.ColorPicker/ColorCanvas/Themes/Generic.xaml new file mode 100644 index 000000000..a54e2f6a5 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/ColorCanvas/Themes/Generic.xaml @@ -0,0 +1,602 @@ +<!--*********************************************************************************** + + Extended WPF Toolkit + + Copyright (C) 2007-2013 Xceed Software Inc. + + This program is provided to you under the terms of the Microsoft Public + License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license + + For more features, controls, and fast professional support, + pick up the Plus Edition at http://xceed.com/wpf_toolkit + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + **********************************************************************************--> + +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:Tango" + xmlns:conv="clr-namespace:Tango.ColorPicker.Core.Converters"> + + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="/Tango.ColorPicker;component/Themes/Brushes.xaml"></ResourceDictionary> + <ResourceDictionary Source="/Tango.ColorPicker;component/Themes/Glyphs.xaml"></ResourceDictionary> + <ResourceDictionary Source="/Tango.ColorPicker;component/Themes/Buttons.xaml"></ResourceDictionary> + <ResourceDictionary Source="/Tango.ColorPicker;component/Themes/Common.xaml"></ResourceDictionary> + </ResourceDictionary.MergedDictionaries> + + <conv:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrushConverter" /> + <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> + + <LinearGradientBrush x:Key="ColorPickerDarkBorderBrush" + EndPoint="0.5,1" + StartPoint="0.5,0"> + <GradientStop Color="#FFA3AEB9" + Offset="0" /> + <GradientStop Color="#FF8399A9" + Offset="0.375" /> + <GradientStop Color="#FF718597" + Offset="0.375" /> + <GradientStop Color="#FF617584" + Offset="1" /> + </LinearGradientBrush> + + <LinearGradientBrush x:Key="ColorCanvasBackgroundBrush" + StartPoint="0,0" + EndPoint="0,1"> + <LinearGradientBrush.GradientStops> + <GradientStopCollection> + <GradientStop Offset="0" + Color="#FFffffff" /> + <GradientStop Offset="1" + Color="#FFE8EBED" /> + </GradientStopCollection> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + + <SolidColorBrush x:Key="HorizontalSliderTrackNormalBackground" + Color="#FFE7EAEA" /> + + <LinearGradientBrush x:Key="HorizontalSliderTrackNormalBorder" + EndPoint="0,1" + StartPoint="0,0"> + <GradientStop Color="#FFAEB1AF" + Offset="0.1" /> + <GradientStop Color="White" + Offset=".9" /> + </LinearGradientBrush> + + <LinearGradientBrush x:Key="ThumbStroke" + EndPoint="0.5,1" + StartPoint="0.5,0"> + <GradientStop Color="#FFA3AEB9" + Offset="0" /> + <GradientStop Color="#FF8399A9" + Offset="0.375" /> + <GradientStop Color="#FF718597" + Offset="0.375" /> + <GradientStop Color="#FF617584" + Offset="1" /> + </LinearGradientBrush> + + <LinearGradientBrush x:Key="ThumbFill" + StartPoint="0,0" + EndPoint="0,1"> + <LinearGradientBrush.GradientStops> + <GradientStopCollection> + <GradientStop Offset="0" + Color="#FFfefefe" /> + <GradientStop Offset="0.5" + Color="#FFeff1f2" /> + <GradientStop Offset="1" + Color="#FFd0d6db" /> + </GradientStopCollection> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + + <SolidColorBrush x:Key="ThumbMouseOver" + Color="#FFE5F2F6" /> + + <Style x:Key="ColorCanvasTextBoxStyle" + TargetType="TextBox" + BasedOn="{StaticResource {x:Type TextBox}}"> + <Setter Property="Background" + Value="Transparent" /> + <Style.Triggers> + <Trigger Property="IsFocused" + Value="False"> + <Setter Property="BorderBrush" + Value="Transparent" /> + </Trigger> + </Style.Triggers> + </Style> + + <Style x:Key="SliderRepeatButtonStyle" + TargetType="{x:Type RepeatButton}"> + <Setter Property="OverridesDefaultStyle" + Value="true" /> + <Setter Property="IsTabStop" + Value="false" /> + <Setter Property="Focusable" + Value="false" /> + <Setter Property="Background" + Value="Transparent" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type RepeatButton}"> + <Border Background="{TemplateBinding Background}" /> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Key="CustomThumbForSlider" + TargetType="{x:Type Thumb}"> + <Setter Property="OverridesDefaultStyle" + Value="True" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type Thumb}"> + <Rectangle x:Name="_thumb" + Fill="{StaticResource ThumbFill}" + Stroke="{StaticResource ThumbStroke}" + Height="14" + Width="8" + RadiusX="1" + RadiusY="1" /> + <ControlTemplate.Triggers> + <Trigger Property="IsMouseOver" + Value="True"> + <Setter TargetName="_thumb" + Property="Rectangle.Fill" + Value="{StaticResource ThumbMouseOver}" /> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Key="VerticalSlideThumbStyle" + TargetType="{x:Type Thumb}"> + <Setter Property="Focusable" + Value="false" /> + <Setter Property="OverridesDefaultStyle" + Value="true" /> + <Setter Property="Height" + Value="12" /> + <Setter Property="Width" + Value="11" /> + <Setter Property="Foreground" + Value="Gray" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type Thumb}"> + <Canvas SnapsToDevicePixels="true"> + <Path x:Name="LeftArrow" + Stretch="Fill" + StrokeLineJoin="Round" + Stroke="#FF000000" + Fill="#FF000000" + Data="F1 M 276.761,316L 262.619,307.835L 262.619,324.165L 276.761,316 Z " + RenderTransformOrigin="0.5,0.5" + Width="6" + Height="8"> + <Path.RenderTransform> + <TransformGroup> + <ScaleTransform /> + <SkewTransform /> + <RotateTransform /> + <TranslateTransform Y="6" + X="-3" /> + </TransformGroup> + </Path.RenderTransform> + </Path> + <Path x:Name="RightArrow" + Stretch="Fill" + StrokeLineJoin="Round" + Stroke="#FF000000" + Fill="#FF000000" + Data="F1 M 276.761,316L 262.619,307.835L 262.619,324.165L 276.761,316 Z " + RenderTransformOrigin="0.5,0.5" + Width="6" + Height="8"> + <Path.RenderTransform> + <TransformGroup> + <ScaleTransform /> + <SkewTransform /> + <RotateTransform Angle="-180" /> + <TranslateTransform Y="6" + X="8" /> + </TransformGroup> + </Path.RenderTransform> + </Path> + </Canvas> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Key="ColorCanvasSliderStyle" + TargetType="{x:Type Slider}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type Slider}"> + <Border BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + Background="{TemplateBinding Background}" + SnapsToDevicePixels="true"> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" + MinHeight="{TemplateBinding MinHeight}" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + <TickBar x:Name="TopTick" + Fill="{TemplateBinding Foreground}" + Height="4" + Placement="Top" + Grid.Row="0" + Visibility="Collapsed" /> + <TickBar x:Name="BottomTick" + Fill="{TemplateBinding Foreground}" + Height="4" + Placement="Bottom" + Grid.Row="2" + Visibility="Collapsed" /> + <Border x:Name="TrackBackground" + BorderBrush="{StaticResource HorizontalSliderTrackNormalBorder}" + BorderThickness="1" + Background="{StaticResource HorizontalSliderTrackNormalBackground}" + CornerRadius="1" + Height="4.0" + Margin="5,0" + Grid.Row="1" + VerticalAlignment="center"> + <Canvas Margin="-6,-1"> + <Rectangle x:Name="PART_SelectionRange" + Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" + Height="4.0" + Stroke="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" + StrokeThickness="1.0" + Visibility="Hidden" /> + </Canvas> + </Border> + <Track x:Name="PART_Track" + Grid.Row="1"> + <Track.DecreaseRepeatButton> + <RepeatButton Command="{x:Static Slider.DecreaseLarge}" + Style="{StaticResource SliderRepeatButtonStyle}" /> + </Track.DecreaseRepeatButton> + <Track.IncreaseRepeatButton> + <RepeatButton Command="{x:Static Slider.IncreaseLarge}" + Style="{StaticResource SliderRepeatButtonStyle}" /> + </Track.IncreaseRepeatButton> + <Track.Thumb> + <Thumb x:Name="Thumb" + Style="{StaticResource CustomThumbForSlider}" /> + </Track.Thumb> + </Track> + </Grid> + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style TargetType="{x:Type local:ColorCanvas}"> + <Setter Property="Background" + Value="{StaticResource ColorCanvasBackgroundBrush}" /> + <Setter Property="BorderBrush" + Value="{StaticResource ColorPickerDarkBorderBrush}" /> + <Setter Property="BorderThickness" + Value="1" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type local:ColorCanvas}"> + <Border Background="{TemplateBinding Background}" + BorderThickness="{TemplateBinding BorderThickness}" + BorderBrush="{TemplateBinding BorderBrush}" + Padding="3"> + <Grid Margin="2"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="200" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + + <Border BorderThickness="1" + BorderBrush="DarkGray" + ClipToBounds="True" + Background="{StaticResource CheckerBrush}"> + <Canvas x:Name="PART_ColorShadingCanvas" + Width="200" + Height="100" + HorizontalAlignment="Left" + VerticalAlignment="Top"> + <Rectangle x:Name="ColorShadingRectangle" + Height="{Binding ElementName=PART_ColorShadingCanvas, Path=Height}" + Width="{Binding ElementName=PART_ColorShadingCanvas, Path=Width}" + Fill="{Binding SelectedColor, ElementName=PART_SpectrumSlider, Converter={StaticResource ColorToSolidColorBrushConverter}}" /> + <Rectangle x:Name="WhiteGradient" + Width="{Binding ElementName=PART_ColorShadingCanvas,Path=Width}" + Height="{Binding ElementName=PART_ColorShadingCanvas,Path=Height}"> + <Rectangle.Fill> + <LinearGradientBrush StartPoint="0,0" + EndPoint="1,0"> + <GradientStop Offset="0" + Color="#ffffffff" /> + <GradientStop Offset="1" + Color="Transparent" /> + </LinearGradientBrush> + </Rectangle.Fill> + </Rectangle> + <Rectangle x:Name="BlackGradient" + Width="{Binding ElementName=PART_ColorShadingCanvas,Path=Width}" + Height="{Binding ElementName=PART_ColorShadingCanvas,Path=Height}"> + <Rectangle.Fill> + <LinearGradientBrush StartPoint="0,1" + EndPoint="0, 0"> + <GradientStop Offset="0" + Color="#ff000000" /> + <GradientStop Offset="1" + Color="#00000000" /> + </LinearGradientBrush> + </Rectangle.Fill> + </Rectangle> + <Canvas x:Name="PART_ColorShadeSelector" + Width="10" + Height="10" + IsHitTestVisible="False"> + <Ellipse Width="10" + Height="10" + StrokeThickness="3" + Stroke="#FFFFFFFF" + IsHitTestVisible="False" /> + <Ellipse Width="10" + Height="10" + StrokeThickness="1" + Stroke="#FF000000" + IsHitTestVisible="False" /> + </Canvas> + </Canvas> + </Border> + + <Border Grid.Row="1" + Margin="0,5,0,0"> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + <Border x:Name="SelectedColorBorder" + Background="{StaticResource CheckerBrush}" + Height="22" + Margin="2,0,2,0" + BorderThickness="1" + BorderBrush="#FFC9CACA"> + <Rectangle x:Name="SelectedColor" + Fill="{Binding SelectedColor, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ColorToSolidColorBrushConverter}}" /> + </Border> + <TextBox x:Name="PART_HexadecimalTextBox" + Grid.Column="1" + Margin="2,0,2,0" + VerticalAlignment="Center" + Style="{StaticResource ColorCanvasTextBoxStyle}" /> + </Grid> + </Border> + + <Border Grid.Column="1" + Grid.RowSpan="2" + Margin="4,-8,0,0" + ClipToBounds="False"> + <local:ColorSpectrumSlider x:Name="PART_SpectrumSlider" + VerticalAlignment="Stretch" /> + </Border> + </Grid> + + <Border x:Name="RGBBorder" + MinWidth="180" + Grid.Row="1" + BorderThickness="1" + ClipToBounds="True" + Margin="0,10,0,0"> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> + + <TextBlock Grid.Row="0" + Grid.Column="0" + Text="R" + VerticalAlignment="Center" /> + <Slider x:Name="PART_RSlider" + Maximum="255" + SmallChange="1" + LargeChange="10" + TickFrequency="1" + Grid.Row="0" + Grid.Column="1" + Margin="4,6,4,6" + Style="{StaticResource ColorCanvasSliderStyle}" + Value="{Binding R, RelativeSource={RelativeSource TemplatedParent}}" + VerticalAlignment="Center" /> + <TextBox Grid.Row="0" + Grid.Column="2" + Text="{Binding Value, ElementName=PART_RSlider}" + VerticalAlignment="Center" + Style="{StaticResource ColorCanvasTextBoxStyle}" /> + + <TextBlock Grid.Row="1" + Grid.Column="0" + Text="G" + VerticalAlignment="Center" /> + <Slider x:Name="PART_GSlider" + Maximum="255" + SmallChange="1" + LargeChange="10" + TickFrequency="1" + Grid.Row="1" + Grid.Column="1" + Margin="4,6,4,6" + Style="{StaticResource ColorCanvasSliderStyle}" + Value="{Binding G, RelativeSource={RelativeSource TemplatedParent}}" + VerticalAlignment="Center" /> + <TextBox Grid.Row="1" + Grid.Column="2" + Text="{Binding Value, ElementName=PART_GSlider}" + VerticalAlignment="Center" + Style="{StaticResource ColorCanvasTextBoxStyle}" /> + + <TextBlock Grid.Row="2" + Grid.Column="0" + Text="B" + VerticalAlignment="Center" /> + <Slider x:Name="PART_BSlider" + Maximum="255" + SmallChange="1" + LargeChange="10" + TickFrequency="1" + Grid.Row="2" + Grid.Column="1" + Margin="4,6,4,6" + Style="{StaticResource ColorCanvasSliderStyle}" + Value="{Binding B, RelativeSource={RelativeSource TemplatedParent}}" + VerticalAlignment="Center" /> + <TextBox Grid.Row="2" + Grid.Column="3" + Text="{Binding Value, ElementName=PART_BSlider}" + VerticalAlignment="Center" + Style="{StaticResource ColorCanvasTextBoxStyle}" /> + + <TextBlock Grid.Row="3" + Grid.Column="0" + Text="A" + VerticalAlignment="Center" + Visibility="{Binding Path=UsingAlphaChannel, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}" /> + <Slider x:Name="PART_OpacitySlider" + Grid.Row="3" + Grid.Column="1" + Maximum="255" + SmallChange="1" + LargeChange="10" + Margin="4,6,4,6" + Style="{StaticResource ColorCanvasSliderStyle}" + Value="{Binding Path=A, RelativeSource={RelativeSource TemplatedParent}}" + VerticalAlignment="Center" + Visibility="{Binding Path=UsingAlphaChannel, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}" /> + <TextBox Grid.Row="3" + Grid.Column="3" + Text="{Binding Value, ElementName=PART_OpacitySlider}" + VerticalAlignment="Center" + Style="{StaticResource ColorCanvasTextBoxStyle}" + Visibility="{Binding Path=UsingAlphaChannel, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}" /> + </Grid> + </Border> + </Grid> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsEnabled" + Value="False"> + <Setter Property="Foreground" + Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" /> + </Trigger> + <Trigger Property="SelectedColor" + Value="{x:Null}"> + <Setter Property="Visibility" + Value="Collapsed" + TargetName="PART_ColorShadeSelector" /> + <Setter Property="Background" + Value="Transparent" + TargetName="SelectedColorBorder" /> + <Setter Property="IsEnabled" + Value="False" + TargetName="RGBBorder" /> + <Setter Property="TextElement.Foreground" + Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" + TargetName="RGBBorder" /> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style TargetType="{x:Type local:ColorSpectrumSlider}"> + <Setter Property="BorderBrush" + Value="DarkGray" /> + <Setter Property="BorderThickness" + Value="1" /> + <Setter Property="Orientation" + Value="Vertical" /> + <Setter Property="Background" + Value="Transparent" /> + <Setter Property="Foreground" + Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" /> + <Setter Property="Minimum" + Value="0" /> + <Setter Property="Maximum" + Value="360" /> + <Setter Property="TickFrequency" + Value="0.001" /> + <Setter Property="IsSnapToTickEnabled" + Value="True" /> + <Setter Property="IsDirectionReversed" + Value="False" /> + <Setter Property="IsMoveToPointEnabled" + Value="True" /> + <Setter Property="Value" + Value="0" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type local:ColorSpectrumSlider}"> + <Grid> + <Border BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + Margin="0,8,0,0"> + <Border x:Name="PART_TrackBackground" + Width="15"> + <Rectangle x:Name="PART_SpectrumDisplay" + Stretch="Fill" + VerticalAlignment="Stretch" /> + </Border> + </Border> + + <Track Name="PART_Track"> + <Track.DecreaseRepeatButton> + <RepeatButton Style="{StaticResource SliderRepeatButtonStyle}" + Command="Slider.DecreaseLarge" /> + </Track.DecreaseRepeatButton> + <Track.IncreaseRepeatButton> + <RepeatButton Style="{StaticResource SliderRepeatButtonStyle}" + Command="Slider.IncreaseLarge" /> + </Track.IncreaseRepeatButton> + <Track.Thumb> + <Thumb Style="{StaticResource VerticalSlideThumbStyle}" /> + </Track.Thumb> + </Track> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + +</ResourceDictionary> diff --git a/Software/Visual_Studio/Tango.ColorPicker/ColorPicker/Implementation/ColorItem.cs b/Software/Visual_Studio/Tango.ColorPicker/ColorPicker/Implementation/ColorItem.cs new file mode 100644 index 000000000..dbf1860f7 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/ColorPicker/Implementation/ColorItem.cs @@ -0,0 +1,53 @@ +/************************************************************************************* + + Extended WPF Toolkit + + Copyright (C) 2007-2013 Xceed Software Inc. + + This program is provided to you under the terms of the Microsoft Public + License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license + + For more features, controls, and fast professional support, + pick up the Plus Edition at http://xceed.com/wpf_toolkit + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + ***********************************************************************************/ + +using System.Windows.Media; + +namespace Tango +{ + internal class ColorItem + { + public Color? Color + { + get; + set; + } + public string Name + { + get; + set; + } + + public ColorItem(Color? color, string name) + { + Color = color; + Name = name; + } + + public override bool Equals(object obj) + { + var ci = obj as ColorItem; + if (ci == null) + return false; + return (ci.Color.Equals(Color) && ci.Name.Equals(Name)); + } + + public override int GetHashCode() + { + return this.Color.GetHashCode() ^ this.Name.GetHashCode(); + } + } +} diff --git a/Software/Visual_Studio/Tango.ColorPicker/ColorPicker/Implementation/ColorPicker.cs b/Software/Visual_Studio/Tango.ColorPicker/ColorPicker/Implementation/ColorPicker.cs new file mode 100644 index 000000000..aff0ae661 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/ColorPicker/Implementation/ColorPicker.cs @@ -0,0 +1,770 @@ +/************************************************************************************* + + Extended WPF Toolkit + + Copyright (C) 2007-2013 Xceed Software Inc. + + This program is provided to you under the terms of the Microsoft Public + License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license + + For more features, controls, and fast professional support, + pick up the Plus Edition at http://xceed.com/wpf_toolkit + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + ***********************************************************************************/ + +using System; +using System.Collections.ObjectModel; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; +using System.Windows.Media; +using Tango.ColorPicker.Core.Utilities; +using System.Windows.Controls.Primitives; +using System.Linq; +using System.Collections.Generic; +using System.Windows.Data; +using Tango.ColorPicker; + +namespace Tango +{ + internal enum ColorMode + { + ColorPalette, + ColorCanvas + } + + internal enum ColorSortingMode + { + Alphabetical, + HueSaturationBrightness + } + + [TemplatePart(Name = PART_AvailableColors, Type = typeof(ListBox))] + [TemplatePart(Name = PART_StandardColors, Type = typeof(ListBox))] + [TemplatePart(Name = PART_RecentColors, Type = typeof(ListBox))] + [TemplatePart(Name = PART_ColorPickerToggleButton, Type = typeof(ToggleButton))] + [TemplatePart(Name = PART_ColorPickerPalettePopup, Type = typeof(Popup))] + [TemplatePart(Name = PART_ColorModeButton, Type = typeof(Button))] + public class ColorPickerCombo : Control + { + private const string PART_AvailableColors = "PART_AvailableColors"; + private const string PART_StandardColors = "PART_StandardColors"; + private const string PART_RecentColors = "PART_RecentColors"; + private const string PART_ColorPickerToggleButton = "PART_ColorPickerToggleButton"; + private const string PART_ColorPickerPalettePopup = "PART_ColorPickerPalettePopup"; + private const string PART_ColorModeButton = "PART_ColorModeButton"; + + #region Members + + private ListBox _availableColors; + private ListBox _standardColors; + private ListBox _recentColors; + private ToggleButton _toggleButton; + private Popup _popup; + private Button _colorModeButton; + private Color? _initialColor; + private bool _selectionChanged; + + #endregion //Members + + #region Properties + + #region AdvancedButtonHeader + + public static readonly DependencyProperty AdvancedButtonHeaderProperty = DependencyProperty.Register("AdvancedButtonHeader", typeof(string), typeof(ColorPickerCombo), new UIPropertyMetadata("Advanced")); + public string AdvancedButtonHeader + { + get + { + return (string)GetValue(AdvancedButtonHeaderProperty); + } + set + { + SetValue(AdvancedButtonHeaderProperty, value); + } + } + + #endregion //AdvancedButtonHeader + + #region AvailableColors + + internal static readonly DependencyProperty AvailableColorsProperty = DependencyProperty.Register("AvailableColors", typeof(ObservableCollection<ColorItem>), typeof(ColorPickerCombo), new UIPropertyMetadata(CreateAvailableColors())); + internal ObservableCollection<ColorItem> AvailableColors + { + get + { + return (ObservableCollection<ColorItem>)GetValue(AvailableColorsProperty); + } + set + { + SetValue(AvailableColorsProperty, value); + } + } + + #endregion //AvailableColors + + #region AvailableColorsSortingMode + + internal static readonly DependencyProperty AvailableColorsSortingModeProperty = DependencyProperty.Register("AvailableColorsSortingMode", typeof(ColorSortingMode), typeof(ColorPickerCombo), new UIPropertyMetadata(ColorSortingMode.Alphabetical, OnAvailableColorsSortingModeChanged)); + internal ColorSortingMode AvailableColorsSortingMode + { + get + { + return (ColorSortingMode)GetValue(AvailableColorsSortingModeProperty); + } + set + { + SetValue(AvailableColorsSortingModeProperty, value); + } + } + + private static void OnAvailableColorsSortingModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + ColorPickerCombo colorPicker = (ColorPickerCombo)d; + if (colorPicker != null) + colorPicker.OnAvailableColorsSortingModeChanged((ColorSortingMode)e.OldValue, (ColorSortingMode)e.NewValue); + } + + private void OnAvailableColorsSortingModeChanged(ColorSortingMode oldValue, ColorSortingMode newValue) + { + ListCollectionView lcv = (ListCollectionView)(CollectionViewSource.GetDefaultView(this.AvailableColors)); + if (lcv != null) + { + lcv.CustomSort = (AvailableColorsSortingMode == ColorSortingMode.HueSaturationBrightness) + ? new ColorSorter() + : null; + } + } + + #endregion //AvailableColorsSortingMode + + #region AvailableColorsHeader + + public static readonly DependencyProperty AvailableColorsHeaderProperty = DependencyProperty.Register("AvailableColorsHeader", typeof(string), typeof(ColorPickerCombo), new UIPropertyMetadata("Available Colors")); + public string AvailableColorsHeader + { + get + { + return (string)GetValue(AvailableColorsHeaderProperty); + } + set + { + SetValue(AvailableColorsHeaderProperty, value); + } + } + + #endregion //AvailableColorsHeader + + #region ButtonStyle + + public static readonly DependencyProperty ButtonStyleProperty = DependencyProperty.Register("ButtonStyle", typeof(Style), typeof(ColorPickerCombo)); + public Style ButtonStyle + { + get + { + return (Style)GetValue(ButtonStyleProperty); + } + set + { + SetValue(ButtonStyleProperty, value); + } + } + + #endregion //ButtonStyle + + #region DisplayColorAndName + + public static readonly DependencyProperty DisplayColorAndNameProperty = DependencyProperty.Register("DisplayColorAndName", typeof(bool), typeof(ColorPickerCombo), new UIPropertyMetadata(false)); + public bool DisplayColorAndName + { + get + { + return (bool)GetValue(DisplayColorAndNameProperty); + } + set + { + SetValue(DisplayColorAndNameProperty, value); + } + } + + #endregion //DisplayColorAndName + + #region ColorMode + + internal static readonly DependencyProperty ColorModeProperty = DependencyProperty.Register("ColorMode", typeof(ColorMode), typeof(ColorPickerCombo), new UIPropertyMetadata(ColorMode.ColorPalette)); + internal ColorMode ColorMode + { + get + { + return (ColorMode)GetValue(ColorModeProperty); + } + set + { + SetValue(ColorModeProperty, value); + } + } + + #endregion //ColorMode + + #region IsOpen + + public static readonly DependencyProperty IsOpenProperty = DependencyProperty.Register("IsOpen", typeof(bool), typeof(ColorPickerCombo), new UIPropertyMetadata(false, OnIsOpenChanged)); + public bool IsOpen + { + get + { + return (bool)GetValue(IsOpenProperty); + } + set + { + SetValue(IsOpenProperty, value); + } + } + + private static void OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + ColorPickerCombo colorPicker = (ColorPickerCombo)d; + if (colorPicker != null) + colorPicker.OnIsOpenChanged((bool)e.OldValue, (bool)e.NewValue); + } + + private void OnIsOpenChanged(bool oldValue, bool newValue) + { + if (newValue) + { + _initialColor = this.SelectedColor; + } + RoutedEventArgs args = new RoutedEventArgs(newValue ? OpenedEvent : ClosedEvent, this); + this.RaiseEvent(args); + } + + #endregion //IsOpen + + #region RecentColors + + internal static readonly DependencyProperty RecentColorsProperty = DependencyProperty.Register("RecentColors", typeof(ObservableCollection<ColorItem>), typeof(ColorPickerCombo), new UIPropertyMetadata(null)); + internal ObservableCollection<ColorItem> RecentColors + { + get + { + return (ObservableCollection<ColorItem>)GetValue(RecentColorsProperty); + } + set + { + SetValue(RecentColorsProperty, value); + } + } + + #endregion //RecentColors + + #region RecentColorsHeader + + public static readonly DependencyProperty RecentColorsHeaderProperty = DependencyProperty.Register("RecentColorsHeader", typeof(string), typeof(ColorPickerCombo), new UIPropertyMetadata("Recent Colors")); + public string RecentColorsHeader + { + get + { + return (string)GetValue(RecentColorsHeaderProperty); + } + set + { + SetValue(RecentColorsHeaderProperty, value); + } + } + + #endregion //RecentColorsHeader + + #region SelectedColor + + public static readonly DependencyProperty SelectedColorProperty = DependencyProperty.Register("SelectedColor", typeof(Color?), typeof(ColorPickerCombo), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback(OnSelectedColorPropertyChanged))); + public Color? SelectedColor + { + get + { + return (Color?)GetValue(SelectedColorProperty); + } + set + { + SetValue(SelectedColorProperty, value); + } + } + + private static void OnSelectedColorPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + ColorPickerCombo colorPicker = (ColorPickerCombo)d; + if (colorPicker != null) + colorPicker.OnSelectedColorChanged((Color?)e.OldValue, (Color?)e.NewValue); + } + + private void OnSelectedColorChanged(Color? oldValue, Color? newValue) + { + SelectedColorText = GetFormatedColorString(newValue); + + RoutedPropertyChangedEventArgs<Color?> args = new RoutedPropertyChangedEventArgs<Color?>(oldValue, newValue); + args.RoutedEvent = ColorPickerCombo.SelectedColorChangedEvent; + RaiseEvent(args); + } + + #endregion //SelectedColor + + #region SelectedColorText + + public static readonly DependencyProperty SelectedColorTextProperty = DependencyProperty.Register("SelectedColorText", typeof(string), typeof(ColorPickerCombo), new UIPropertyMetadata("")); + public string SelectedColorText + { + get + { + return (string)GetValue(SelectedColorTextProperty); + } + protected set + { + SetValue(SelectedColorTextProperty, value); + } + } + + #endregion //SelectedColorText + + #region ShowAdvancedButton + + public static readonly DependencyProperty ShowAdvancedButtonProperty = DependencyProperty.Register("ShowAdvancedButton", typeof(bool), typeof(ColorPickerCombo), new UIPropertyMetadata(true)); + public bool ShowAdvancedButton + { + get + { + return (bool)GetValue(ShowAdvancedButtonProperty); + } + set + { + SetValue(ShowAdvancedButtonProperty, value); + } + } + + #endregion //ShowAdvancedButton + + #region ShowAvailableColors + + public static readonly DependencyProperty ShowAvailableColorsProperty = DependencyProperty.Register("ShowAvailableColors", typeof(bool), typeof(ColorPickerCombo), new UIPropertyMetadata(true)); + public bool ShowAvailableColors + { + get + { + return (bool)GetValue(ShowAvailableColorsProperty); + } + set + { + SetValue(ShowAvailableColorsProperty, value); + } + } + + #endregion //ShowAvailableColors + + #region ShowRecentColors + + public static readonly DependencyProperty ShowRecentColorsProperty = DependencyProperty.Register("ShowRecentColors", typeof(bool), typeof(ColorPickerCombo), new UIPropertyMetadata(false)); + public bool ShowRecentColors + { + get + { + return (bool)GetValue(ShowRecentColorsProperty); + } + set + { + SetValue(ShowRecentColorsProperty, value); + } + } + + #endregion //DisplayRecentColors + + #region ShowStandardColors + + public static readonly DependencyProperty ShowStandardColorsProperty = DependencyProperty.Register("ShowStandardColors", typeof(bool), typeof(ColorPickerCombo), new UIPropertyMetadata(true)); + public bool ShowStandardColors + { + get + { + return (bool)GetValue(ShowStandardColorsProperty); + } + set + { + SetValue(ShowStandardColorsProperty, value); + } + } + + #endregion //DisplayStandardColors + + #region ShowDropDownButton + + public static readonly DependencyProperty ShowDropDownButtonProperty = DependencyProperty.Register("ShowDropDownButton", typeof(bool), typeof(ColorPickerCombo), new UIPropertyMetadata(true)); + public bool ShowDropDownButton + { + get + { + return (bool)GetValue(ShowDropDownButtonProperty); + } + set + { + SetValue(ShowDropDownButtonProperty, value); + } + } + + #endregion //ShowDropDownButton + + #region StandardButtonHeader + + public static readonly DependencyProperty StandardButtonHeaderProperty = DependencyProperty.Register("StandardButtonHeader", typeof(string), typeof(ColorPickerCombo), new UIPropertyMetadata("Standard")); + public string StandardButtonHeader + { + get + { + return (string)GetValue(StandardButtonHeaderProperty); + } + set + { + SetValue(StandardButtonHeaderProperty, value); + } + } + + #endregion //StandardButtonHeader + + #region StandardColors + + internal static readonly DependencyProperty StandardColorsProperty = DependencyProperty.Register("StandardColors", typeof(ObservableCollection<ColorItem>), typeof(ColorPickerCombo), new UIPropertyMetadata(CreateStandardColors())); + internal ObservableCollection<ColorItem> StandardColors + { + get + { + return (ObservableCollection<ColorItem>)GetValue(StandardColorsProperty); + } + set + { + SetValue(StandardColorsProperty, value); + } + } + + #endregion //StandardColors + + #region StandardColorsHeader + + public static readonly DependencyProperty StandardColorsHeaderProperty = DependencyProperty.Register("StandardColorsHeader", typeof(string), typeof(ColorPickerCombo), new UIPropertyMetadata("Standard Colors")); + public string StandardColorsHeader + { + get + { + return (string)GetValue(StandardColorsHeaderProperty); + } + set + { + SetValue(StandardColorsHeaderProperty, value); + } + } + + #endregion //StandardColorsHeader + + #region UsingAlphaChannel + + public static readonly DependencyProperty UsingAlphaChannelProperty = DependencyProperty.Register("UsingAlphaChannel", typeof(bool), typeof(ColorPickerCombo), new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback(OnUsingAlphaChannelPropertyChanged))); + public bool UsingAlphaChannel + { + get + { + return (bool)GetValue(UsingAlphaChannelProperty); + } + set + { + SetValue(UsingAlphaChannelProperty, value); + } + } + + private static void OnUsingAlphaChannelPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + ColorPickerCombo colorPicker = (ColorPickerCombo)d; + if (colorPicker != null) + colorPicker.OnUsingAlphaChannelChanged(); + } + + private void OnUsingAlphaChannelChanged() + { + SelectedColorText = GetFormatedColorString(SelectedColor); + } + + #endregion //UsingAlphaChannel + + #endregion //Properties + + #region Constructors + + static ColorPickerCombo() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(ColorPickerCombo), new FrameworkPropertyMetadata(typeof(ColorPickerCombo))); + } + + public ColorPickerCombo() + { +#if VS2008 + this.RecentColors = new ObservableCollection<ColorItem>(); +#else + this.SetCurrentValue(ColorPickerCombo.RecentColorsProperty, new ObservableCollection<ColorItem>()); +#endif + + Keyboard.AddKeyDownHandler(this, OnKeyDown); + Mouse.AddPreviewMouseDownOutsideCapturedElementHandler(this, OnMouseDownOutsideCapturedElement); + } + + #endregion //Constructors + + #region Base Class Overrides + + public override void OnApplyTemplate() + { + base.OnApplyTemplate(); + + if (_availableColors != null) + _availableColors.SelectionChanged -= Color_SelectionChanged; + + _availableColors = GetTemplateChild(PART_AvailableColors) as ListBox; + if (_availableColors != null) + _availableColors.SelectionChanged += Color_SelectionChanged; + + if (_standardColors != null) + _standardColors.SelectionChanged -= Color_SelectionChanged; + + _standardColors = GetTemplateChild(PART_StandardColors) as ListBox; + if (_standardColors != null) + _standardColors.SelectionChanged += Color_SelectionChanged; + + if (_recentColors != null) + _recentColors.SelectionChanged -= Color_SelectionChanged; + + _recentColors = GetTemplateChild(PART_RecentColors) as ListBox; + if (_recentColors != null) + _recentColors.SelectionChanged += Color_SelectionChanged; + + if (_popup != null) + _popup.Opened -= Popup_Opened; + + _popup = GetTemplateChild(PART_ColorPickerPalettePopup) as Popup; + if (_popup != null) + _popup.Opened += Popup_Opened; + + _toggleButton = this.Template.FindName(PART_ColorPickerToggleButton, this) as ToggleButton; + + if (_colorModeButton != null) + _colorModeButton.Click -= new RoutedEventHandler(this.ColorModeButton_Clicked); + + _colorModeButton = this.Template.FindName(PART_ColorModeButton, this) as Button; + + if (_colorModeButton != null) + _colorModeButton.Click += new RoutedEventHandler(this.ColorModeButton_Clicked); + } + + protected override void OnMouseUp(MouseButtonEventArgs e) + { + base.OnMouseUp(e); + + // Close ColorPicker on MouseUp to prevent action of mouseUp on controls behind the ColorPicker. + if (_selectionChanged) + { + CloseColorPicker(true); + _selectionChanged = false; + } + } + + #endregion //Base Class Overrides + + #region Event Handlers + + private void OnKeyDown(object sender, KeyEventArgs e) + { + if (!IsOpen) + { + if (KeyboardUtilities.IsKeyModifyingPopupState(e)) + { + IsOpen = true; + // Focus will be on ListBoxItem in Popup_Opened(). + e.Handled = true; + } + } + else + { + if (KeyboardUtilities.IsKeyModifyingPopupState(e)) + { + CloseColorPicker(true); + e.Handled = true; + } + else if (e.Key == Key.Escape) + { + this.SelectedColor = _initialColor; + CloseColorPicker(true); + e.Handled = true; + } + } + } + + private void OnMouseDownOutsideCapturedElement(object sender, MouseButtonEventArgs e) + { + CloseColorPicker(true); + } + + private void Color_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + ListBox lb = (ListBox)sender; + + if (e.AddedItems.Count > 0) + { + var colorItem = (ColorItem)e.AddedItems[0]; + SelectedColor = colorItem.Color; + UpdateRecentColors(colorItem); + _selectionChanged = true; + lb.SelectedIndex = -1; //for now I don't care about keeping track of the selected color + } + } + + private void Popup_Opened(object sender, EventArgs e) + { + if ((_availableColors != null) && ShowAvailableColors) + FocusOnListBoxItem(_availableColors); + else if ((_standardColors != null) && ShowStandardColors) + FocusOnListBoxItem(_standardColors); + else if ((_recentColors != null) && ShowRecentColors) + FocusOnListBoxItem(_recentColors); + } + + private void FocusOnListBoxItem(ListBox listBox) + { + ListBoxItem listBoxItem = (ListBoxItem)listBox.ItemContainerGenerator.ContainerFromItem(listBox.SelectedItem); + if ((listBoxItem == null) && (listBox.Items.Count > 0)) + listBoxItem = (ListBoxItem)listBox.ItemContainerGenerator.ContainerFromItem(listBox.Items[0]); + if (listBoxItem != null) + listBoxItem.Focus(); + } + + private void ColorModeButton_Clicked(object sender, RoutedEventArgs e) + { + this.ColorMode = (this.ColorMode == ColorMode.ColorPalette) ? ColorMode.ColorCanvas : ColorMode.ColorPalette; + } + + #endregion //Event Handlers + + #region Events + + #region SelectedColorChangedEvent + + public static readonly RoutedEvent SelectedColorChangedEvent = EventManager.RegisterRoutedEvent("SelectedColorChanged", RoutingStrategy.Bubble, typeof(RoutedPropertyChangedEventHandler<Color?>), typeof(ColorPickerCombo)); + public event RoutedPropertyChangedEventHandler<Color?> SelectedColorChanged + { + add + { + AddHandler(SelectedColorChangedEvent, value); + } + remove + { + RemoveHandler(SelectedColorChangedEvent, value); + } + } + + #endregion + + #region OpenedEvent + + public static readonly RoutedEvent OpenedEvent = EventManager.RegisterRoutedEvent("OpenedEvent", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(ColorPickerCombo)); + public event RoutedEventHandler Opened + { + add + { + AddHandler(OpenedEvent, value); + } + remove + { + RemoveHandler(OpenedEvent, value); + } + } + + #endregion //OpenedEvent + + #region ClosedEvent + + public static readonly RoutedEvent ClosedEvent = EventManager.RegisterRoutedEvent("ClosedEvent", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(ColorPickerCombo)); + public event RoutedEventHandler Closed + { + add + { + AddHandler(ClosedEvent, value); + } + remove + { + RemoveHandler(ClosedEvent, value); + } + } + + #endregion //ClosedEvent + + #endregion //Events + + #region Methods + + private void CloseColorPicker(bool isFocusOnColorPicker) + { + if (IsOpen) + IsOpen = false; + ReleaseMouseCapture(); + + if (isFocusOnColorPicker && (_toggleButton != null)) + _toggleButton.Focus(); + this.UpdateRecentColors(new ColorItem(SelectedColor, SelectedColorText)); + } + + private void UpdateRecentColors(ColorItem colorItem) + { + if (!RecentColors.Contains(colorItem)) + RecentColors.Add(colorItem); + + if (RecentColors.Count > 10) //don't allow more than ten, maybe make a property that can be set by the user. + RecentColors.RemoveAt(0); + } + + private string GetFormatedColorString(Color? colorToFormat) + { + if ((colorToFormat == null) || !colorToFormat.HasValue) + return string.Empty; + + return ColorUtilities.FormatColorString(colorToFormat.Value.GetColorName(), UsingAlphaChannel); + } + + private static ObservableCollection<ColorItem> CreateStandardColors() + { + ObservableCollection<ColorItem> _standardColors = new ObservableCollection<ColorItem>(); + _standardColors.Add(new ColorItem(Colors.Transparent, "Transparent")); + _standardColors.Add(new ColorItem(Colors.White, "White")); + _standardColors.Add(new ColorItem(Colors.Gray, "Gray")); + _standardColors.Add(new ColorItem(Colors.Black, "Black")); + _standardColors.Add(new ColorItem(Colors.Red, "Red")); + _standardColors.Add(new ColorItem(Colors.Green, "Green")); + _standardColors.Add(new ColorItem(Colors.Blue, "Blue")); + _standardColors.Add(new ColorItem(Colors.Yellow, "Yellow")); + _standardColors.Add(new ColorItem(Colors.Orange, "Orange")); + _standardColors.Add(new ColorItem(Colors.Purple, "Purple")); + return _standardColors; + } + + private static ObservableCollection<ColorItem> CreateAvailableColors() + { + ObservableCollection<ColorItem> _standardColors = new ObservableCollection<ColorItem>(); + + foreach (var item in ColorUtilities.KnownColors) + { + if (!String.Equals(item.Key, "Transparent")) + { + var colorItem = new ColorItem(item.Value, item.Key); + if (!_standardColors.Contains(colorItem)) + _standardColors.Add(colorItem); + } + } + + return _standardColors; + } + + #endregion //Methods + } +} diff --git a/Software/Visual_Studio/Tango.ColorPicker/ColorPicker/Implementation/ColorSorter.cs b/Software/Visual_Studio/Tango.ColorPicker/ColorPicker/Implementation/ColorSorter.cs new file mode 100644 index 000000000..fa33faa55 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/ColorPicker/Implementation/ColorSorter.cs @@ -0,0 +1,77 @@ +/************************************************************************************* + + Extended WPF Toolkit + + Copyright (C) 2007-2013 Xceed Software Inc. + + This program is provided to you under the terms of the Microsoft Public + License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license + + For more features, controls, and fast professional support, + pick up the Plus Edition at http://xceed.com/wpf_toolkit + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + ***********************************************************************************/ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Media; + +namespace Tango.ColorPicker +{ + internal class ColorSorter : IComparer + { + public int Compare( object firstItem, object secondItem ) + { + if( firstItem == null || secondItem == null ) + return -1; + + ColorItem colorItem1 = ( ColorItem )firstItem; + ColorItem colorItem2 = ( ColorItem )secondItem; + + if( (colorItem1.Color == null) || !colorItem1.Color.HasValue || + (colorItem2.Color == null) || !colorItem2.Color.HasValue ) + return -1; + + System.Drawing.Color drawingColor1 = System.Drawing.Color.FromArgb( colorItem1.Color.Value.A, colorItem1.Color.Value.R, colorItem1.Color.Value.G, colorItem1.Color.Value.B ); + System.Drawing.Color drawingColor2 = System.Drawing.Color.FromArgb( colorItem2.Color.Value.A, colorItem2.Color.Value.R, colorItem2.Color.Value.G, colorItem2.Color.Value.B ); + + // Compare Hue + double hueColor1 = Math.Round( ( double )drawingColor1.GetHue(), 3 ); + double hueColor2 = Math.Round( ( double )drawingColor2.GetHue(), 3 ); + + if( hueColor1 > hueColor2 ) + return 1; + else if( hueColor1 < hueColor2 ) + return -1; + else + { + // Hue is equal, compare Saturation + double satColor1 = Math.Round( ( double )drawingColor1.GetSaturation(), 3 ); + double satColor2 = Math.Round( ( double )drawingColor2.GetSaturation(), 3 ); + + if( satColor1 > satColor2 ) + return 1; + else if( satColor1 < satColor2 ) + return -1; + else + { + // Saturation is equal, compare Brightness + double brightColor1 = Math.Round( ( double )drawingColor1.GetBrightness(), 3 ); + double brightColor2 = Math.Round( ( double )drawingColor2.GetBrightness(), 3 ); + + if( brightColor1 > brightColor2 ) + return 1; + else if( brightColor1 < brightColor2 ) + return -1; + } + } + + return 0; + } + } +} diff --git a/Software/Visual_Studio/Tango.ColorPicker/ColorPicker/Themes/Generic.xaml b/Software/Visual_Studio/Tango.ColorPicker/ColorPicker/Themes/Generic.xaml new file mode 100644 index 000000000..996da3308 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/ColorPicker/Themes/Generic.xaml @@ -0,0 +1,356 @@ +<!--*********************************************************************************** + + Extended WPF Toolkit + + Copyright (C) 2007-2013 Xceed Software Inc. + + This program is provided to you under the terms of the Microsoft Public + License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license + + For more features, controls, and fast professional support, + pick up the Plus Edition at http://xceed.com/wpf_toolkit + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + **********************************************************************************--> + +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:Tango" + xmlns:conv="clr-namespace:Tango.ColorPicker.Core.Converters" + xmlns:sys="clr-namespace:System;assembly=mscorlib" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:chrome="clr-namespace:Tango.ColorPicker"> + + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="/Tango.ColorPicker;component/Themes/Brushes.xaml"></ResourceDictionary> + <ResourceDictionary Source="/Tango.ColorPicker;component/Themes/Glyphs.xaml"></ResourceDictionary> + <ResourceDictionary Source="/Tango.ColorPicker;component/Themes/Buttons.xaml"></ResourceDictionary> + <ResourceDictionary Source="/Tango.ColorPicker;component/Themes/Common.xaml"></ResourceDictionary> + <ResourceDictionary Source="/Tango.ColorPicker;component/ColorCanvas/Themes/Generic.xaml"></ResourceDictionary> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" /> + </ResourceDictionary.MergedDictionaries> + + <SolidColorBrush x:Key="ButtonHover" Color="#C2E0FF" /> + <SolidColorBrush x:Key="ButtonHoverBorder" Color="#3399FF" /> + <SolidColorBrush x:Key="ButtonChecked" Color="#E6F0FA" /> + <SolidColorBrush x:Key="ButtonPressed" Color="#99CCFF" /> + <SolidColorBrush x:Key="ButtonPressedBorder" Color="#3399FF" /> + + + <!-- =============================================================================== --> + <!-- ColorPicker --> + <!-- =============================================================================== --> + + <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> + <conv:InverseBoolConverter x:Key="InverseBoolConverter" /> + <conv:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrushConverter" /> + + <LinearGradientBrush x:Key="ColorPickerDarkBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0"> + <GradientStop Color="#FFA3AEB9" Offset="0" /> + <GradientStop Color="#FF8399A9" Offset="0.375" /> + <GradientStop Color="#FF718597" Offset="0.375" /> + <GradientStop Color="#FF617584" Offset="1" /> + </LinearGradientBrush> + + <LinearGradientBrush x:Key="PopupBackgroundBrush" StartPoint="0,0" EndPoint="0,1"> + <LinearGradientBrush.GradientStops> + <GradientStopCollection> + <GradientStop Offset="0" Color="#FFffffff" /> + <GradientStop Offset="1" Color="#FFE8EBED" /> + </GradientStopCollection> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + + <Style x:Key="ColorItemContainerStyle" TargetType="{x:Type ListBoxItem}"> + <Setter Property="ToolTip" Value="{Binding Name}" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ListBoxItem}"> + <Grid x:Name="mainGrid" + ToolTip="{Binding Name}"> + <Grid.Resources> + <Style TargetType="ToolTip"> + <Style.Triggers> + <Trigger Property="Content" + Value="{x:Static sys:String.Empty}"> + <Setter Property="Visibility" + Value="Collapsed" /> + </Trigger> + </Style.Triggers> + </Style> + </Grid.Resources> + <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" /> + <Border BorderThickness="1" Background="Transparent" BorderBrush="Transparent" x:Name="_outerBorder" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> + <Border Background="Transparent" BorderThickness="1" BorderBrush="Transparent" x:Name="_innerBorder" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /> + </Border> + </Grid> + <ControlTemplate.Triggers> + <Trigger Property="IsMouseOver" Value="True"> + <Setter TargetName="_outerBorder" Property="BorderBrush" Value="#FFFF0000" /> + <Setter TargetName="_innerBorder" Property="BorderBrush" Value="#FFFFFF00" /> + </Trigger> + <Trigger Property="IsSelected" Value="True"> + <Setter TargetName="_outerBorder" Property="BorderBrush" Value="#FFFF0000" /> + <Setter TargetName="_innerBorder" Property="BorderBrush" Value="#FFFFFF00" /> + </Trigger> + <DataTrigger Binding="{Binding DisplayColorAndName, RelativeSource={RelativeSource AncestorType={x:Type local:ColorPickerCombo}}}" + Value="False"> + <Setter Property="ToolTip" + Value="{x:Static sys:String.Empty}" + TargetName="mainGrid" /> + </DataTrigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <DataTemplate x:Key="ColorItemTemplate"> + <Grid> + <Border Background="{StaticResource CheckerBrush}" BorderBrush="Black" BorderThickness="1" Margin="2,2,2,2" > + <Rectangle Width="14" Height="14"> + <Rectangle.Style> + <Style TargetType="Rectangle"> + <Setter Property="Fill" Value="{Binding Color, Converter={StaticResource ColorToSolidColorBrushConverter}}" /> + </Style> + </Rectangle.Style> + </Rectangle> + </Border> + </Grid> + </DataTemplate> + + <Style x:Key="ColorPickerToggleButtonStyle" TargetType="ToggleButton"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="ToggleButton"> + <Grid SnapsToDevicePixels="True"> + + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*"/> + <ColumnDefinition Width="Auto"/> + </Grid.ColumnDefinitions> + + <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True"> + <ContentPresenter Content="{TemplateBinding Content}" + ContentTemplate="{TemplateBinding ContentTemplate}" + ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" /> + </Border> + + <chrome:ButtonChrome x:Name="ToggleButtonChrome" + Grid.Column="1" + CornerRadius="0,2.75,2.75,0" + Visibility="{Binding ShowDropDownButton, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ColorPickerCombo}, Converter={StaticResource BooleanToVisibilityConverter}}" + RenderChecked="{Binding IsOpen, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ColorPickerCombo}}" + RenderEnabled="{Binding IsEnabled, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ColorPickerCombo}}" + RenderMouseOver="{TemplateBinding IsMouseOver}" + RenderPressed="{TemplateBinding IsPressed}"> + + <Grid x:Name="arrowGlyph" IsHitTestVisible="False" Grid.Column="1" Margin="5"> + <Path x:Name="Arrow" + Width="9" + Height="5" + Data="{StaticResource DownArrowGeometry}" + Fill="#FF000000" + Margin="0,1,0,0"/> + </Grid> + </chrome:ButtonChrome> + </Grid> + + </Grid> + <ControlTemplate.Triggers> + <Trigger Property="IsEnabled" Value="False"> + <Setter Property="Fill" TargetName="Arrow" Value="#AFAFAF" /> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Key="ColorDisplayStyle" TargetType="ContentControl"> + <Setter Property="Focusable" + Value="False" /> + <Setter Property="ContentTemplate"> + <Setter.Value> + <DataTemplate> + <Border Background="{StaticResource CheckerBrush}"> + <Rectangle Fill="{Binding SelectedColor, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ColorPickerCombo}, Converter={StaticResource ColorToSolidColorBrushConverter}}" /> + </Border> + </DataTemplate> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding SelectedColor, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ColorPickerCombo}}" + Value="{x:Null}"> + <Setter Property="Visibility" + Value="Collapsed" /> + </DataTrigger> + </Style.Triggers> + </Style> + + <Style x:Key="ColorListStyle" TargetType="ListBox"> + <Setter Property="Background" Value="Transparent" /> + <Setter Property="BorderThickness" Value="0" /> + <Setter Property="ItemsPanel"> + <Setter.Value> + <ItemsPanelTemplate> + <WrapPanel Width="200" /> + </ItemsPanelTemplate> + </Setter.Value> + </Setter> + <Setter Property="ItemContainerStyle" Value="{StaticResource ColorItemContainerStyle}" /> + <Setter Property="ItemTemplate" Value="{StaticResource ColorItemTemplate}" /> + <Setter Property="SelectionMode" Value="Single" /> + </Style> + + <Style TargetType="{x:Type local:ColorPickerCombo}"> + <Setter Property="Background" Value="White" /> + <Setter Property="BorderBrush" Value="{StaticResource ColorPickerDarkBorderBrush}" /> + <Setter Property="BorderThickness" Value="1,1,0,1" /> + <Setter Property="ButtonStyle" Value="{StaticResource ColorPickerToggleButtonStyle}" /> + <Setter Property="Focusable" Value="False" /> + <Setter Property="HorizontalContentAlignment" Value="Stretch" /> + <Setter Property="VerticalContentAlignment" Value="Stretch" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type local:ColorPickerCombo}"> + <Grid> + <ToggleButton x:Name="PART_ColorPickerToggleButton" Style="{x:Null}" Background="#E9E9E9" + IsTabStop="True" + MinHeight="22" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + Padding="{TemplateBinding Padding}" + IsChecked="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" + IsHitTestVisible="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolConverter}}" + > + <Grid Margin="2"> + <ContentControl x:Name="ColorOnly" Style="{StaticResource ColorDisplayStyle}" Visibility="Hidden" /> + + <Border x:Name="ColorAndName" Background="Transparent" BorderThickness="0"> + <StackPanel Orientation="Horizontal"> + <ContentControl HorizontalAlignment="Left" Margin="0 0 10 0" Width="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}" Style="{StaticResource ColorDisplayStyle}" BorderThickness="0" BorderBrush="#FFC9CACA" /> + <TextBlock Text="{Binding SelectedColorText, RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center" /> + </StackPanel> + </Border> + </Grid> + </ToggleButton> + + <Popup x:Name="PART_ColorPickerPalettePopup" + VerticalAlignment="Bottom" + IsOpen="{Binding ElementName=PART_ColorPickerToggleButton, Path=IsChecked}" + StaysOpen="False" + AllowsTransparency="True" + Focusable="False" + HorizontalOffset="1" + VerticalOffset="1" + PopupAnimation="Slide" + ToolTip="{x:Static sys:String.Empty}"> + <Popup.Resources> + <Style TargetType="ToolTip"> + <Style.Triggers> + <Trigger Property="Content" + Value="{x:Static sys:String.Empty}"> + <Setter Property="Visibility" + Value="Collapsed" /> + </Trigger> + </Style.Triggers> + </Style> + </Popup.Resources> + <Border BorderThickness="1" Opacity="1" Background="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=Background}" BorderBrush="{StaticResource ColorPickerDarkBorderBrush}" Padding="3"> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + + <Grid x:Name="_colorPaletteHost" Visibility="Collapsed" Margin="4"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + + <TabControl> + <TabItem Header="Standard Colors"> + + <!-- Available Colors --> + <Grid Grid.Row="1" Visibility="{TemplateBinding ShowAvailableColors, Converter={StaticResource BooleanToVisibilityConverter}}"> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition /> + </Grid.RowDefinitions> + <ListBox x:Name="PART_AvailableColors" + Grid.Row="1" + ItemsSource="{Binding AvailableColors, RelativeSource={RelativeSource TemplatedParent}}" + Style="{StaticResource ColorListStyle}" /> + </Grid> + </Grid> + + </TabItem> + + <TabItem Header="Canvas"> + <!-- ColorCanvas --> + <Grid> + <Grid Visibility="Visible"> + <local:ColorCanvas Background="Transparent" + BorderThickness="0" + UsingAlphaChannel="False" + SelectedColor="{Binding SelectedColor, RelativeSource={RelativeSource TemplatedParent}}" /> + </Grid> + <Grid x:Name="_colorCanvasHost" Visibility="Visible"> + <local:ColorCanvas Background="Transparent" + BorderThickness="0" + UsingAlphaChannel="{Binding UsingAlphaChannel, RelativeSource={RelativeSource TemplatedParent}}" + SelectedColor="{Binding SelectedColor, RelativeSource={RelativeSource TemplatedParent}}" /> + </Grid> + </Grid> + </TabItem> + </TabControl> + </Grid> + <!-- More Colors Button --> + <Button x:Name="PART_ColorModeButton" Grid.Row="2" Margin="5" Visibility="Collapsed" /> + </Grid> + </Border> + </Popup> + </Grid> + <ControlTemplate.Triggers> + <Trigger Property="DisplayColorAndName" Value="True"> + <Setter TargetName="ColorOnly" Property="Visibility" Value="Collapsed" /> + <Setter TargetName="ColorAndName" Property="Visibility" Value="Visible" /> + </Trigger> + + <Trigger Property="ColorMode" Value="ColorPalette"> + <Setter TargetName="_colorPaletteHost" Property="Visibility" Value="Visible" /> + <Setter TargetName="_colorCanvasHost" Property="Visibility" Value="Collapsed" /> + <Setter TargetName="PART_ColorModeButton" + Property="Content" + Value="{Binding AdvancedButtonHeader, RelativeSource={RelativeSource TemplatedParent}}" /> + </Trigger> + + <Trigger Property="ColorMode" Value="ColorCanvas"> + <Setter TargetName="_colorPaletteHost" Property="Visibility" Value="Collapsed" /> + <Setter TargetName="_colorCanvasHost" Property="Visibility" Value="Visible" /> + <Setter TargetName="PART_ColorModeButton" + Property="Content" + Value="{Binding StandardButtonHeader, RelativeSource={RelativeSource TemplatedParent}}" /> + </Trigger> + + <Trigger Property="ShowDropDownButton" Value="False"> + <Setter Property="BorderThickness" Value="1" /> + </Trigger> + + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + +</ResourceDictionary> diff --git a/Software/Visual_Studio/Tango.ColorPicker/ColorToSolidColorBrushConverter.cs b/Software/Visual_Studio/Tango.ColorPicker/ColorToSolidColorBrushConverter.cs new file mode 100644 index 000000000..730bc29d6 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/ColorToSolidColorBrushConverter.cs @@ -0,0 +1,67 @@ +/************************************************************************************* + + Extended WPF Toolkit + + Copyright (C) 2007-2013 Xceed Software Inc. + + This program is provided to you under the terms of the Microsoft Public + License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license + + For more features, controls, and fast professional support, + pick up the Plus Edition at http://xceed.com/wpf_toolkit + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + ***********************************************************************************/ + +using System; +using System.Windows.Data; +using System.Windows.Media; + +namespace Tango.ColorPicker.Core.Converters +{ + internal class ColorToSolidColorBrushConverter : IValueConverter + { + #region IValueConverter Members + + /// <summary> + /// Converts a Color to a SolidColorBrush. + /// </summary> + /// <param name="value">The Color produced by the binding source.</param> + /// <param name="targetType">The type of the binding target property.</param> + /// <param name="parameter">The converter parameter to use.</param> + /// <param name="culture">The culture to use in the converter.</param> + /// <returns> + /// A converted SolidColorBrush. If the method returns null, the valid null value is used. + /// </returns> + public object Convert( object value, Type targetType, object parameter, System.Globalization.CultureInfo culture ) + { + if( value != null ) + return new SolidColorBrush( ( Color )value ); + + return value; + } + + + /// <summary> + /// Converts a SolidColorBrush to a Color. + /// </summary> + /// <remarks>Currently not used in toolkit, but provided for developer use in their own projects</remarks> + /// <param name="value">The SolidColorBrush that is produced by the binding target.</param> + /// <param name="targetType">The type to convert to.</param> + /// <param name="parameter">The converter parameter to use.</param> + /// <param name="culture">The culture to use in the converter.</param> + /// <returns> + /// A converted value. If the method returns null, the valid null value is used. + /// </returns> + public object ConvertBack( object value, Type targetType, object parameter, System.Globalization.CultureInfo culture ) + { + if( value != null ) + return ( ( SolidColorBrush )value ).Color; + + return value; + } + + #endregion + } +} diff --git a/Software/Visual_Studio/Tango.ColorPicker/ColorUtilities.cs b/Software/Visual_Studio/Tango.ColorPicker/ColorUtilities.cs new file mode 100644 index 000000000..1be254437 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/ColorUtilities.cs @@ -0,0 +1,205 @@ +/************************************************************************************* + + Extended WPF Toolkit + + Copyright (C) 2007-2013 Xceed Software Inc. + + This program is provided to you under the terms of the Microsoft Public + License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license + + For more features, controls, and fast professional support, + pick up the Plus Edition at http://xceed.com/wpf_toolkit + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + ***********************************************************************************/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Windows.Media; +using Tango.ColorPicker.Primitives; + +namespace Tango.ColorPicker.Core.Utilities +{ + internal static class ColorUtilities + { + public static readonly Dictionary<string, Color> KnownColors = GetKnownColors(); + + public static string GetColorName( this Color color ) + { + string colorName = KnownColors.Where( kvp => kvp.Value.Equals( color ) ).Select( kvp => kvp.Key ).FirstOrDefault(); + + if( String.IsNullOrEmpty( colorName ) ) + colorName = color.ToString(); + + return colorName; + } + + public static string FormatColorString( string stringToFormat, bool isUsingAlphaChannel ) + { + if( !isUsingAlphaChannel && ( stringToFormat.Length == 9 ) ) + return stringToFormat.Remove( 1, 2 ); + return stringToFormat; + } + + private static Dictionary<string, Color> GetKnownColors() + { + var colorProperties = typeof( Colors ).GetProperties( BindingFlags.Static | BindingFlags.Public ); + return colorProperties.ToDictionary( p => p.Name, p => ( Color )p.GetValue( null, null ) ); + } + + /// <summary> + /// Converts an RGB color to an HSV color. + /// </summary> + /// <param name="r"></param> + /// <param name="b"></param> + /// <param name="g"></param> + /// <returns></returns> + public static HsvColor ConvertRgbToHsv( int r, int b, int g ) + { + double delta, min; + double h = 0, s, v; + + min = Math.Min( Math.Min( r, g ), b ); + v = Math.Max( Math.Max( r, g ), b ); + delta = v - min; + + if( v == 0.0 ) + { + s = 0; + } + else + s = delta / v; + + if( s == 0 ) + h = 0.0; + + else + { + if( r == v ) + h = ( g - b ) / delta; + else if( g == v ) + h = 2 + ( b - r ) / delta; + else if( b == v ) + h = 4 + ( r - g ) / delta; + + h *= 60; + if( h < 0.0 ) + h = h + 360; + + } + + return new HsvColor + { + H = h, + S = s, + V = v / 255 + }; + } + + /// <summary> + /// Converts an HSV color to an RGB color. + /// </summary> + /// <param name="h"></param> + /// <param name="s"></param> + /// <param name="v"></param> + /// <returns></returns> + public static Color ConvertHsvToRgb( double h, double s, double v ) + { + double r = 0, g = 0, b = 0; + + if( s == 0 ) + { + r = v; + g = v; + b = v; + } + else + { + int i; + double f, p, q, t; + + if( h == 360 ) + h = 0; + else + h = h / 60; + + i = ( int )Math.Truncate( h ); + f = h - i; + + p = v * ( 1.0 - s ); + q = v * ( 1.0 - ( s * f ) ); + t = v * ( 1.0 - ( s * ( 1.0 - f ) ) ); + + switch( i ) + { + case 0: + { + r = v; + g = t; + b = p; + break; + } + case 1: + { + r = q; + g = v; + b = p; + break; + } + case 2: + { + r = p; + g = v; + b = t; + break; + } + case 3: + { + r = p; + g = q; + b = v; + break; + } + case 4: + { + r = t; + g = p; + b = v; + break; + } + default: + { + r = v; + g = p; + b = q; + break; + } + } + + } + + return Color.FromArgb( 255, ( byte )( Math.Round(r * 255) ), ( byte )( Math.Round(g * 255) ), ( byte )( Math.Round(b * 255) ) ); + } + + /// <summary> + /// Generates a list of colors with hues ranging from 0 360 and a saturation and value of 1. + /// </summary> + /// <returns></returns> + public static List<Color> GenerateHsvSpectrum() + { + List<Color> colorsList = new List<Color>( 8 ); + + for( int i = 0; i < 29; i++ ) + { + colorsList.Add( ColorUtilities.ConvertHsvToRgb( i * 12, 1, 1 ) ); + } + + colorsList.Add( ColorUtilities.ConvertHsvToRgb( 0, 1, 1 ) ); + + return colorsList; + } + } +} diff --git a/Software/Visual_Studio/Tango.ColorPicker/HsvColor.cs b/Software/Visual_Studio/Tango.ColorPicker/HsvColor.cs new file mode 100644 index 000000000..fa4beb8f5 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/HsvColor.cs @@ -0,0 +1,32 @@ +/************************************************************************************* + + Extended WPF Toolkit + + Copyright (C) 2007-2013 Xceed Software Inc. + + This program is provided to you under the terms of the Microsoft Public + License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license + + For more features, controls, and fast professional support, + pick up the Plus Edition at http://xceed.com/wpf_toolkit + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + ***********************************************************************************/ + +namespace Tango.ColorPicker.Primitives +{ + internal struct HsvColor + { + public double H; + public double S; + public double V; + + public HsvColor( double h, double s, double v ) + { + H = h; + S = s; + V = v; + } + } +} diff --git a/Software/Visual_Studio/Tango.ColorPicker/InverseBoolConverter.cs b/Software/Visual_Studio/Tango.ColorPicker/InverseBoolConverter.cs new file mode 100644 index 000000000..11598a1ed --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/InverseBoolConverter.cs @@ -0,0 +1,38 @@ +/************************************************************************************* + + Extended WPF Toolkit + + Copyright (C) 2007-2013 Xceed Software Inc. + + This program is provided to you under the terms of the Microsoft Public + License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license + + For more features, controls, and fast professional support, + pick up the Plus Edition at http://xceed.com/wpf_toolkit + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + ***********************************************************************************/ + +using System; +using System.Windows.Data; + +namespace Tango.ColorPicker.Core.Converters +{ + internal class InverseBoolConverter : IValueConverter + { + #region IValueConverter Members + + public object Convert( object value, Type targetType, object parameter, System.Globalization.CultureInfo culture ) + { + return !( bool )value; + } + + public object ConvertBack( object value, Type targetType, object parameter, System.Globalization.CultureInfo culture ) + { + throw new NotImplementedException(); + } + + #endregion + } +} diff --git a/Software/Visual_Studio/Tango.ColorPicker/KeyboardUtilities.cs b/Software/Visual_Studio/Tango.ColorPicker/KeyboardUtilities.cs new file mode 100644 index 000000000..a7a2a0870 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/KeyboardUtilities.cs @@ -0,0 +1,33 @@ +/************************************************************************************* + + Extended WPF Toolkit + + Copyright (C) 2007-2013 Xceed Software Inc. + + This program is provided to you under the terms of the Microsoft Public + License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license + + For more features, controls, and fast professional support, + pick up the Plus Edition at http://xceed.com/wpf_toolkit + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + ***********************************************************************************/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Input; + +namespace Tango.ColorPicker.Core.Utilities +{ + internal class KeyboardUtilities + { + internal static bool IsKeyModifyingPopupState( KeyEventArgs e ) + { + return ( ( ( ( Keyboard.Modifiers & ModifierKeys.Alt ) == ModifierKeys.Alt ) && ( ( e.SystemKey == Key.Down ) || ( e.SystemKey == Key.Up ) ) ) + || ( e.Key == Key.F4 ) ); + } + } +} diff --git a/Software/Visual_Studio/Tango.ColorPicker/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.ColorPicker/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..ac8cb5adb --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +[assembly: AssemblyTitle("Tango - Color Picker Control")] +[assembly: ComVisible(false)] + + +[assembly:ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/Software/Visual_Studio/Tango.ColorPicker/Properties/Resources.Designer.cs b/Software/Visual_Studio/Tango.ColorPicker/Properties/Resources.Designer.cs new file mode 100644 index 000000000..09502e5a8 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace Tango.ColorPicker.Properties { + using System; + + + /// <summary> + /// A strongly-typed resource class, for looking up localized strings, etc. + /// </summary> + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// <summary> + /// Returns the cached ResourceManager instance used by this class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.ColorPicker.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Software/Visual_Studio/Tango.ColorPicker/Properties/Resources.resx b/Software/Visual_Studio/Tango.ColorPicker/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/Properties/Resources.resx @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.ColorPicker/Properties/Settings.Designer.cs b/Software/Visual_Studio/Tango.ColorPicker/Properties/Settings.Designer.cs new file mode 100644 index 000000000..3f2514fb6 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace Tango.ColorPicker.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.1.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/Software/Visual_Studio/Tango.ColorPicker/Properties/Settings.settings b/Software/Visual_Studio/Tango.ColorPicker/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/Properties/Settings.settings @@ -0,0 +1,7 @@ +<?xml version='1.0' encoding='utf-8'?> +<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)"> + <Profiles> + <Profile Name="(Default)" /> + </Profiles> + <Settings /> +</SettingsFile>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.ColorPicker/ResourceKeys.cs b/Software/Visual_Studio/Tango.ColorPicker/ResourceKeys.cs new file mode 100644 index 000000000..466a49840 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/ResourceKeys.cs @@ -0,0 +1,61 @@ +/************************************************************************************* + + Extended WPF Toolkit + + Copyright (C) 2007-2013 Xceed Software Inc. + + This program is provided to you under the terms of the Microsoft Public + License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license + + For more features, controls, and fast professional support, + pick up the Plus Edition at http://xceed.com/wpf_toolkit + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + ***********************************************************************************/ + +using System.Windows; + +namespace Tango.ColorPicker.Themes +{ + internal static class ResourceKeys + { + #region Brush Keys + + public static readonly ComponentResourceKey ControlNormalBackgroundKey = new ComponentResourceKey( typeof( ResourceKeys ), "ControlNormalBackgroundKey" ); + public static readonly ComponentResourceKey ControlDisabledBackgroundKey = new ComponentResourceKey( typeof( ResourceKeys ), "ControlDisabledBackgroundKey" ); + public static readonly ComponentResourceKey ControlNormalBorderKey = new ComponentResourceKey( typeof( ResourceKeys ), "ControlNormalBorderKey" ); + public static readonly ComponentResourceKey ControlMouseOverBorderKey = new ComponentResourceKey( typeof( ResourceKeys ), "ControlMouseOverBorderKey" ); + public static readonly ComponentResourceKey ControlSelectedBorderKey = new ComponentResourceKey(typeof(ResourceKeys), "ControlSelectedBorderKey"); + public static readonly ComponentResourceKey ControlFocusedBorderKey = new ComponentResourceKey( typeof( ResourceKeys ), "ControlFocusedBorderKey" ); + + public static readonly ComponentResourceKey ButtonNormalOuterBorderKey = new ComponentResourceKey( typeof( ResourceKeys ), "ButtonNormalOuterBorderKey" ); + public static readonly ComponentResourceKey ButtonNormalInnerBorderKey = new ComponentResourceKey( typeof( ResourceKeys ), "ButtonNormalInnerBorderKey" ); + public static readonly ComponentResourceKey ButtonNormalBackgroundKey = new ComponentResourceKey( typeof( ResourceKeys ), "ButtonNormalBackgroundKey" ); + + public static readonly ComponentResourceKey ButtonMouseOverBackgroundKey = new ComponentResourceKey( typeof( ResourceKeys ), "ButtonMouseOverBackgroundKey" ); + public static readonly ComponentResourceKey ButtonMouseOverOuterBorderKey = new ComponentResourceKey( typeof( ResourceKeys ), "ButtonMouseOverOuterBorderKey" ); + public static readonly ComponentResourceKey ButtonMouseOverInnerBorderKey = new ComponentResourceKey( typeof( ResourceKeys ), "ButtonMouseOverInnerBorderKey" ); + + public static readonly ComponentResourceKey ButtonPressedOuterBorderKey = new ComponentResourceKey( typeof( ResourceKeys ), "ButtonPressedOuterBorderKey" ); + public static readonly ComponentResourceKey ButtonPressedInnerBorderKey = new ComponentResourceKey( typeof( ResourceKeys ), "ButtonPressedInnerBorderKey" ); + public static readonly ComponentResourceKey ButtonPressedBackgroundKey = new ComponentResourceKey( typeof( ResourceKeys ), "ButtonPressedBackgroundKey" ); + + public static readonly ComponentResourceKey ButtonFocusedOuterBorderKey = new ComponentResourceKey( typeof( ResourceKeys ), "ButtonFocusedOuterBorderKey" ); + public static readonly ComponentResourceKey ButtonFocusedInnerBorderKey = new ComponentResourceKey( typeof( ResourceKeys ), "ButtonFocusedInnerBorderKey" ); + public static readonly ComponentResourceKey ButtonFocusedBackgroundKey = new ComponentResourceKey( typeof( ResourceKeys ), "ButtonFocusedBackgroundKey" ); + + public static readonly ComponentResourceKey ButtonDisabledOuterBorderKey = new ComponentResourceKey( typeof( ResourceKeys ), "ButtonDisabledOuterBorderKey" ); + public static readonly ComponentResourceKey ButtonInnerBorderDisabledKey = new ComponentResourceKey( typeof( ResourceKeys ), "ButtonInnerBorderDisabledKey" ); + + #endregion //Brush Keys + + public static readonly ComponentResourceKey GlyphNormalForegroundKey = new ComponentResourceKey( typeof( ResourceKeys ), "GlyphNormalForegroundKey" ); + public static readonly ComponentResourceKey GlyphDisabledForegroundKey = new ComponentResourceKey( typeof( ResourceKeys ), "GlyphDisabledForegroundKey" ); + + public static readonly ComponentResourceKey SpinButtonCornerRadiusKey = new ComponentResourceKey( typeof( ResourceKeys ), "SpinButtonCornerRadiusKey" ); + + public static readonly ComponentResourceKey SpinnerButtonStyleKey = new ComponentResourceKey( typeof( ResourceKeys ), "SpinnerButtonStyleKey" ); + + } +} diff --git a/Software/Visual_Studio/Tango.ColorPicker/Tango.ColorPicker.csproj b/Software/Visual_Studio/Tango.ColorPicker/Tango.ColorPicker.csproj new file mode 100644 index 000000000..c104df2e3 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/Tango.ColorPicker.csproj @@ -0,0 +1,159 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{A2F5AF44-29FF-45D6-9D25-ECDA5CCE88B5}</ProjectGuid> + <OutputType>library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>Tango.ColorPicker</RootNamespace> + <AssemblyName>Tango.ColorPicker</AssemblyName> + <TargetFrameworkVersion>v4.6</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <WarningLevel>4</WarningLevel> + <SccProjectName>SAK</SccProjectName> + <SccLocalPath>SAK</SccLocalPath> + <SccAuxPath>SAK</SccAuxPath> + <SccProvider>SAK</SccProvider> + <TargetFrameworkProfile /> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>..\Build\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup> + <SignAssembly>false</SignAssembly> + </PropertyGroup> + <PropertyGroup> + <AssemblyOriginatorKeyFile> + </AssemblyOriginatorKeyFile> + </PropertyGroup> + <ItemGroup> + <Reference Include="ControlzEx, Version=3.0.2.4, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\packages\ControlzEx.3.0.2.4\lib\net45\ControlzEx.dll</HintPath> + </Reference> + <Reference Include="MahApps.Metro, Version=1.5.0.23, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL"> + <HintPath>..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\MahApps.Metro.1.5.0\lib\net45\System.Windows.Interactivity.dll</HintPath> + <Private>True</Private> + </Reference> + <Reference Include="System.Xml" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Core" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="System.Net.Http" /> + <Reference Include="System.Xaml"> + <RequiredTargetFramework>4.0</RequiredTargetFramework> + </Reference> + <Reference Include="WindowsBase" /> + <Reference Include="PresentationCore" /> + <Reference Include="PresentationFramework" /> + </ItemGroup> + <ItemGroup> + <Page Include="Chromes\Themes\Generic.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="ColorCanvas\Themes\Generic.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="ColorPicker\Themes\Generic.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Themes\Brushes.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Themes\Buttons.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Themes\Generic.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Themes\Common.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Themes\Glyphs.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + </ItemGroup> + <ItemGroup> + <Compile Include="..\Versioning\GlobalVersionInfo.cs"> + <Link>GlobalVersionInfo.cs</Link> + </Compile> + <Compile Include="Chromes\Implementation\ButtonChrome.cs" /> + <Compile Include="ColorBlendConverter.cs" /> + <Compile Include="ColorCanvas\Implementation\ColorCanvas.cs" /> + <Compile Include="ColorCanvas\Implementation\ColorSpectrumSlider.cs" /> + <Compile Include="ColorPicker\Implementation\ColorItem.cs" /> + <Compile Include="ColorPicker\Implementation\ColorPicker.cs" /> + <Compile Include="ColorPicker\Implementation\ColorSorter.cs" /> + <Compile Include="ColorToSolidColorBrushConverter.cs" /> + <Compile Include="ColorUtilities.cs" /> + <Compile Include="HsvColor.cs" /> + <Compile Include="InverseBoolConverter.cs" /> + <Compile Include="KeyboardUtilities.cs" /> + <Compile Include="Properties\AssemblyInfo.cs"> + <SubType>Code</SubType> + </Compile> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> + <Compile Include="Properties\Settings.Designer.cs"> + <AutoGen>True</AutoGen> + <DependentUpon>Settings.settings</DependentUpon> + <DesignTimeSharedInput>True</DesignTimeSharedInput> + </Compile> + <Compile Include="ResourceKeys.cs" /> + <Compile Include="WindowColors.cs" /> + <Compile Include="WindowControl.cs" /> + <EmbeddedResource Include="Properties\Resources.resx"> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + </EmbeddedResource> + <None Include="packages.config" /> + <None Include="Properties\Settings.settings"> + <Generator>SettingsSingleFileGenerator</Generator> + <LastGenOutput>Settings.Designer.cs</LastGenOutput> + </None> + <AppDesigner Include="Properties\" /> + </ItemGroup> + <ItemGroup /> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.ColorPicker/Themes/Brushes.xaml b/Software/Visual_Studio/Tango.ColorPicker/Themes/Brushes.xaml new file mode 100644 index 000000000..c1fa670cd --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/Themes/Brushes.xaml @@ -0,0 +1,216 @@ +<!--*********************************************************************************** + + Extended WPF Toolkit + + Copyright (C) 2007-2013 Xceed Software Inc. + + This program is provided to you under the terms of the Microsoft Public + License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license + + For more features, controls, and fast professional support, + pick up the Plus Edition at http://xceed.com/wpf_toolkit + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + **********************************************************************************--> + +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options" + xmlns:themes="clr-namespace:Tango.ColorPicker.Themes"> + + <SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=ControlNormalBackgroundKey}" + Color="#FFFFFFFF" + options:Freeze="true" /> + <SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=ControlDisabledBackgroundKey}" + Color="#F4F4F4" + options:Freeze="true" /> + + + <LinearGradientBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=ControlNormalBorderKey}" + EndPoint="0,20" + MappingMode="Absolute" + StartPoint="0,0" + options:Freeze="true"> + <GradientStop Color="#ABADB3" + Offset="0.05" /> + <GradientStop Color="#E2E3EA" + Offset="0.07" /> + <GradientStop Color="#E3E9EF" + Offset="1" /> + </LinearGradientBrush> + <LinearGradientBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=ControlMouseOverBorderKey}" + StartPoint="0,0" + EndPoint="0,1" + options:Freeze="true"> + <LinearGradientBrush.GradientStops> + <GradientStopCollection> + <GradientStop Color="#5794BF" + Offset="0.05" /> + <GradientStop Color="#B7D5EA" + Offset="0.07" /> + <GradientStop Color="#C7E2F1" + Offset="1" /> + </GradientStopCollection> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + <LinearGradientBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=ControlFocusedBorderKey}" + StartPoint="0,0" + EndPoint="0,1" + options:Freeze="true"> + <LinearGradientBrush.GradientStops> + <GradientStopCollection> + <GradientStop Color="#3D7BAD" + Offset="0.05" /> + <GradientStop Color="#A4C9E3" + Offset="0.07" /> + <GradientStop Color="#B7D9ED" + Offset="1" /> + </GradientStopCollection> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + + <SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=ButtonNormalOuterBorderKey}" + Color="#FF707070" + options:Freeze="true" /> + <LinearGradientBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=ButtonNormalInnerBorderKey}" + EndPoint="0,1" + StartPoint="0,0" + options:Freeze="true"> + <GradientStop Color="#FAFFFFFF" + Offset="0" /> + <GradientStop Color="#85FFFFFF" + Offset="1" /> + </LinearGradientBrush> + <LinearGradientBrush options:Freeze="true" + x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=ButtonNormalBackgroundKey}" + StartPoint="0,0" + EndPoint="0,1"> + <LinearGradientBrush.GradientStops> + <GradientStopCollection> + <GradientStop Color="#F3F3F3" + Offset="0" /> + <GradientStop Color="#EBEBEB" + Offset="0.5" /> + <GradientStop Color="#DDDDDD" + Offset="0.5" /> + <GradientStop Color="#CDCDCD" + Offset="1" /> + </GradientStopCollection> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + + <SolidColorBrush options:Freeze="true" + x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=ButtonMouseOverOuterBorderKey}" + Color="#3C7FB1" /> + <LinearGradientBrush options:Freeze="true" + x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=ButtonMouseOverInnerBorderKey}" + StartPoint="0,0" + EndPoint="0,1"> + <LinearGradientBrush.GradientStops> + <GradientStopCollection> + <GradientStop Color="#FAFFFFFF" + Offset="0" /> + <GradientStop Color="#85FFFFFF" + Offset="1" /> + </GradientStopCollection> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + <LinearGradientBrush options:Freeze="true" + x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=ButtonMouseOverBackgroundKey}" + StartPoint="0,0" + EndPoint="0,1"> + <LinearGradientBrush.GradientStops> + <GradientStopCollection> + <GradientStop Color="#FFEAF6FD" + Offset="0" /> + <GradientStop Color="#FFD9F0FC" + Offset="0.50" /> + <GradientStop Color="#FFBEE6FD" + Offset="0.50" /> + <GradientStop Color="#FFA7D9F5" + Offset="1" /> + </GradientStopCollection> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + + <SolidColorBrush options:Freeze="true" + x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=ButtonPressedOuterBorderKey}" + Color="#2C628B" /> + <LinearGradientBrush options:Freeze="true" + x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=ButtonPressedInnerBorderKey}" + StartPoint="0,0" + EndPoint="0,1"> + <LinearGradientBrush.GradientStops> + <GradientStopCollection> + <GradientStop Color="#FAFFFFFF" + Offset="0" /> + <GradientStop Color="#85FFFFFF" + Offset="1" /> + </GradientStopCollection> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + <LinearGradientBrush options:Freeze="true" + x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=ButtonPressedBackgroundKey}" + StartPoint="0.5,0" + EndPoint="0.5,1"> + <LinearGradientBrush.GradientStops> + <GradientStopCollection> + <GradientStop Color="#C2E4F6" + Offset="0.5" /> + <GradientStop Color="#ABDAF3" + Offset="0.5" /> + <GradientStop Color="#90CBEB" + Offset="1" /> + </GradientStopCollection> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + + <SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=ButtonFocusedOuterBorderKey}" + Color="#FF707070" + options:Freeze="true" /> + <SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=ButtonFocusedInnerBorderKey}" + Color="#F900CCFF" + options:Freeze="true" /> + <LinearGradientBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=ButtonFocusedBackgroundKey}" + EndPoint="0,1" + StartPoint="0,0" + options:Freeze="true"> + <GradientStop Color="#FFEAF6FD" + Offset="0" /> + <GradientStop Color="#FFD9F0FC" + Offset="0.50" /> + <GradientStop Color="#FFBEE6FD" + Offset="0.50" /> + <GradientStop Color="#FFA7D9F5" + Offset="1" /> + </LinearGradientBrush> + + <SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=ButtonDisabledOuterBorderKey}" + Color="#ADB2B5" + options:Freeze="true" /> + <LinearGradientBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=ButtonInnerBorderDisabledKey}" + EndPoint="0,1" + StartPoint="0,0" + options:Freeze="true"> + <GradientStop Color="#FAFFFFFF" + Offset="0" /> + <GradientStop Color="#85FFFFFF" + Offset="1" /> + </LinearGradientBrush> + + <SolidColorBrush options:Freeze="true" + x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=GlyphNormalForegroundKey}" + Color="#FF000000" /> + <SolidColorBrush options:Freeze="true" + x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=GlyphDisabledForegroundKey}" + Color="#A9A9A9" /> + + <CornerRadius x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=SpinButtonCornerRadiusKey}" + TopLeft="0" + TopRight="0" + BottomRight="0" + BottomLeft="0" + options:Freeze="true" /> + +</ResourceDictionary> diff --git a/Software/Visual_Studio/Tango.ColorPicker/Themes/Buttons.xaml b/Software/Visual_Studio/Tango.ColorPicker/Themes/Buttons.xaml new file mode 100644 index 000000000..50eff3078 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/Themes/Buttons.xaml @@ -0,0 +1,49 @@ +<!--*********************************************************************************** + + Extended WPF Toolkit + + Copyright (C) 2007-2013 Xceed Software Inc. + + This program is provided to you under the terms of the Microsoft Public + License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license + + For more features, controls, and fast professional support, + pick up the Plus Edition at http://xceed.com/wpf_toolkit + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + **********************************************************************************--> + +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:themes="clr-namespace:Tango.ColorPicker.Themes" + xmlns:chrome="clr-namespace:Tango.ColorPicker"> + + <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type themes:ResourceKeys}, ResourceId=SpinnerButtonStyleKey}" + TargetType="RepeatButton"> + <Setter Property="BorderThickness" Value="1" /> + <Setter Property="Padding" Value="2,2" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="RepeatButton"> + <Grid> + <chrome:ButtonChrome x:Name="Chrome" + BorderBrush="{TemplateBinding BorderBrush}" + Background="{TemplateBinding Background}" + CornerRadius="{DynamicResource {x:Static themes:ResourceKeys.SpinButtonCornerRadiusKey}}" + RenderEnabled="{TemplateBinding IsEnabled}" + RenderMouseOver="{TemplateBinding IsMouseOver}" + RenderNormal="True" + RenderPressed="{TemplateBinding IsPressed}" + SnapsToDevicePixels="true" /> + + <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + Margin="{TemplateBinding Padding}" /> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + +</ResourceDictionary> diff --git a/Software/Visual_Studio/Tango.ColorPicker/Themes/Common.xaml b/Software/Visual_Studio/Tango.ColorPicker/Themes/Common.xaml new file mode 100644 index 000000000..58b985cba --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/Themes/Common.xaml @@ -0,0 +1,234 @@ +<!--*********************************************************************************** + + Extended WPF Toolkit + + Copyright (C) 2007-2013 Xceed Software Inc. + + This program is provided to you under the terms of the Microsoft Public + License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license + + For more features, controls, and fast professional support, + pick up the Plus Edition at http://xceed.com/wpf_toolkit + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + **********************************************************************************--> + +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:media="clr-namespace:Tango.ColorPicker.Core.Media" + xmlns:conv="clr-namespace:Tango.ColorPicker.Core.Converters" + xmlns:primitives="clr-namespace:Tango.ColorPicker.Primitives" + xmlns:s="clr-namespace:System;assembly=mscorlib"> + + + <!-- =============================================================================== --> + <!-- Images for the buttons and their various states --> + <!-- =============================================================================== --> + + <!-- ResizeGrip --> + <ImageBrush x:Key="resize_grip" + ImageSource="Images/resize_grip.png" /> + + <Style x:Key="buttonImageStyle" TargetType="Image"> + <Setter Property="Stretch" Value="None" /> + <Setter Property="UseLayoutRounding" Value="True" /> + <Setter Property="RenderOptions.EdgeMode" Value="Aliased" /> + <Setter Property="RenderOptions.BitmapScalingMode" Value="NearestNeighbor" /> + </Style> + + <!-- Minimize --> + <BitmapImage x:Key="minimize_normal" + UriSource="Images/minimize_normal.png" /> + <BitmapImage x:Key="minimize_hover" + UriSource="Images/minimize_hover.png" /> + <BitmapImage x:Key="minimize_pressed" + UriSource="Images/minimize_pressed.png" /> + <BitmapImage x:Key="minimize_inactive" + UriSource="Images/minimize_inactive.png" /> + + <!-- Maximize --> + <BitmapImage x:Key="maximize_normal" + UriSource="Images/maximize_normal.png" /> + <BitmapImage x:Key="maximize_hover" + UriSource="Images/maximize_hover.png" /> + <BitmapImage x:Key="maximize_pressed" + UriSource="Images/maximize_pressed.png" /> + <BitmapImage x:Key="maximize_inactive" + UriSource="Images/maximize_inactive.png" /> + <BitmapImage x:Key="maximize_disabled" + UriSource="Images/maximize_disabled.png" /> + + <!-- Restore --> + <BitmapImage x:Key="restore_normal" + UriSource="Images/restore_normal.png" /> + <BitmapImage x:Key="restore_hover" + UriSource="Images/restore_hover.png" /> + <BitmapImage x:Key="restore_pressed" + UriSource="Images/restore_pressed.png" /> + <BitmapImage x:Key="restore_inactive" + UriSource="Images/restore_inactive.png" /> + <BitmapImage x:Key="restore_disabled" + UriSource="Images/restore_disabled.png" /> + + <!-- Close --> + <BitmapImage x:Key="close_normal" + UriSource="Images/close_normal.png" /> + <BitmapImage x:Key="close_hover" + UriSource="Images/close_hover.png" /> + <BitmapImage x:Key="close_pressed" + UriSource="Images/close_pressed.png" /> + <BitmapImage x:Key="close_inactive" + UriSource="Images/close_inactive.png" /> + + <!-- Close (with 2 rounded corners) --> + <BitmapImage x:Key="close_rounded_normal" + UriSource="Images/close_rounded_normal.png" /> + <BitmapImage x:Key="close_rounded_hover" + UriSource="Images/close_rounded_hover.png" /> + <BitmapImage x:Key="close_rounded_pressed" + UriSource="Images/close_rounded_pressed.png" /> + <BitmapImage x:Key="close_rounded_inactive" + UriSource="Images/close_rounded_inactive.png" /> + + <!-- Close (for ToolWindow) --> + <BitmapImage x:Key="close_toolwindow_normal" + UriSource="Images/close_toolwindow_normal.png" /> + <BitmapImage x:Key="close_toolwindow_hover" + UriSource="Images/close_toolwindow_hover.png" /> + <BitmapImage x:Key="close_toolwindow_pressed" + UriSource="Images/close_toolwindow_pressed.png" /> + <BitmapImage x:Key="close_toolwindow_inactive" + UriSource="Images/close_toolwindow_inactive.png" /> + + + <!-- =============================================================================== --> + <!-- Common Styles --> + <!-- Need to find a way to share these for WindowControl and StyleableWindow --> + <!-- =============================================================================== --> + + <!-- Button template --> + <ControlTemplate x:Key="buttonTemplate" TargetType="Button"> + <Border Name="outerBorder" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}"> + <Image Source="{TemplateBinding Content}" Style="{StaticResource buttonImageStyle}"/> + </Border> + </ControlTemplate> + + <Style x:Key="windowButtonBaseStyle" TargetType="Button"> + <Setter Property="IsTabStop" Value="False" /> + <Setter Property="Margin" Value="0,-1,0,0" /> + <Setter Property="OverridesDefaultStyle" Value="True" /> + <Setter Property="Template" Value="{StaticResource buttonTemplate}" /> + </Style> + + <!--Default Close button style--> + <Style x:Key="{ComponentResourceKey + TypeInTargetAssembly={x:Type primitives:WindowControl}, + ResourceId=DefaultCloseButtonStyle}" + TargetType="Button" + BasedOn="{StaticResource windowButtonBaseStyle}"> + <Setter Property="ToolTip" Value="Close" /> + <Setter Property="Content" Value="{StaticResource close_normal}" /> + <Style.Triggers> + <!-- Regular Window --> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource TemplatedParent},Path=IsActive}" Value="False"> + <Setter Property="Content" Value="{StaticResource close_inactive}" /> + </DataTrigger> + <Trigger Property="IsMouseOver" Value="True"> + <Setter Property="Content" Value="{StaticResource close_hover}" /> + </Trigger> + <Trigger Property="IsPressed" Value="True"> + <Setter Property="Content" Value="{StaticResource close_pressed}" /> + </Trigger> + + <!-- NoResize (Close button with 2 rounded corners) --> + + <!-- Tool Window --> + <Trigger Property="Name" Value="PART_ToolWindowCloseButton"> + <Setter Property="Content" Value="{StaticResource close_toolwindow_normal}" /> + </Trigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding RelativeSource={RelativeSource self},Path=Name}" Value="PART_ToolWindowCloseButton" /> + <Condition Binding="{Binding RelativeSource={RelativeSource TemplatedParent},Path=IsActive}" Value="False" /> + </MultiDataTrigger.Conditions> + <Setter Property="Content" Value="{StaticResource close_toolwindow_inactive}" /> + </MultiDataTrigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="Name" Value="PART_ToolWindowCloseButton" /> + <Condition Property="IsMouseOver" Value="True" /> + </MultiTrigger.Conditions> + <Setter Property="Content" Value="{StaticResource close_toolwindow_hover}" /> + </MultiTrigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="Name" Value="PART_ToolWindowCloseButton" /> + <Condition Property="IsPressed" Value="True" /> + </MultiTrigger.Conditions> + <Setter Property="Content" Value="{StaticResource close_toolwindow_pressed}" /> + </MultiTrigger> + + </Style.Triggers> + </Style> + + + + + + + <SolidColorBrush x:Key="Window_WindowBorderBrush" Color="#FF252C33" /> + + <conv:ColorBlendConverter x:Key="Window_WindowBackground_converter" BlendedColor="#FFA0A0A0" BlendedColorRatio="0.35" /> + <SolidColorBrush x:Key="Window_WindowBackground" + Color="{Binding + Source={x:Static media:WindowColors.ColorizationColor}, + Converter={StaticResource Window_WindowBackground_converter}}" + Opacity="0.85"/> + + <SolidColorBrush x:Key="Window_Background" Color="White"/> + + <SolidColorBrush x:Key="Window_BorderBrush" Color="#5D6C7A" /> + + <s:Double x:Key="Window_CaptionFontSize">15</s:Double> + + <Thickness x:Key="Window_BorderThickness" Left="1" Right="1" Bottom="1" Top="1" /> + + <conv:ColorBlendConverter x:Key="Window_WindowInactiveBackground_converter" BlendedColor="#FFF0F0F0" BlendedColorRatio="0.67" /> + <SolidColorBrush x:Key="Window_WindowInactiveBackground" + Color="{Binding + Source={x:Static media:WindowColors.ColorizationColor}, + Converter={StaticResource Window_WindowInactiveBackground_converter}}" + Opacity="0.85"/> + + <SolidColorBrush x:Key="Window_CaptionForeground" Color="Black"/> + + <Thickness x:Key="Window_WindowBorderThickness">1</Thickness> + + <!-- ========================================================================= --> + <!-- Used by ColorPicker and ColorCanvas --> + <!-- ========================================================================= --> + <DrawingBrush x:Key="CheckerBrush" Viewport="0,0,10,10" ViewportUnits="Absolute" TileMode="Tile"> + <DrawingBrush.Drawing> + <DrawingGroup> + <GeometryDrawing Brush="White"> + <GeometryDrawing.Geometry> + <RectangleGeometry Rect="0,0 100,100" /> + </GeometryDrawing.Geometry> + </GeometryDrawing> + <GeometryDrawing Brush="LightGray"> + <GeometryDrawing.Geometry> + <GeometryGroup> + <RectangleGeometry Rect="0,0 50,50" /> + <RectangleGeometry Rect="50,50 50,50" /> + </GeometryGroup> + </GeometryDrawing.Geometry> + </GeometryDrawing> + </DrawingGroup> + </DrawingBrush.Drawing> + </DrawingBrush> + +</ResourceDictionary> diff --git a/Software/Visual_Studio/Tango.ColorPicker/Themes/Generic.xaml b/Software/Visual_Studio/Tango.ColorPicker/Themes/Generic.xaml new file mode 100644 index 000000000..79e634e15 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/Themes/Generic.xaml @@ -0,0 +1,12 @@ +<ResourceDictionary + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="Tango.ColorPicker;component/Themes/Brushes.xaml"></ResourceDictionary> + <ResourceDictionary Source="Tango.ColorPicker;component/Themes/Glyphs.xaml"></ResourceDictionary> + <ResourceDictionary Source="Tango.ColorPicker;component/Themes/Common.xaml"></ResourceDictionary> + <ResourceDictionary Source="Tango.ColorPicker;component/Themes/Buttons.xaml"></ResourceDictionary> + <ResourceDictionary Source="Tango.ColorPicker;component/ColorCanvas/Themes/Generic.xaml"></ResourceDictionary> + <ResourceDictionary Source="Tango.ColorPicker;component/ColorPicker/Themes/Generic.xaml"></ResourceDictionary> + </ResourceDictionary.MergedDictionaries> +</ResourceDictionary> diff --git a/Software/Visual_Studio/Tango.ColorPicker/Themes/Glyphs.xaml b/Software/Visual_Studio/Tango.ColorPicker/Themes/Glyphs.xaml new file mode 100644 index 000000000..833bca95f --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/Themes/Glyphs.xaml @@ -0,0 +1,67 @@ +<!--*********************************************************************************** + + Extended WPF Toolkit + + Copyright (C) 2007-2013 Xceed Software Inc. + + This program is provided to you under the terms of the Microsoft Public + License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license + + For more features, controls, and fast professional support, + pick up the Plus Edition at http://xceed.com/wpf_toolkit + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + **********************************************************************************--> + +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:themes="clr-namespace:Tango.ColorPicker.Themes"> + + <Geometry x:Key="UpArrowGeometry">M0,5 L4.5,.5 9,5 6,5 4.5,3.5 3,5 z</Geometry> + <Geometry x:Key="DownArrowGeometry">M0,0 L3,0 4.5,1.5 6,0 9,0 4.5,4.5 z</Geometry> + + <DataTemplate x:Key="IncreaseGlyphNormalKey"> + <Path Width="9" + Height="5" + Data="{StaticResource UpArrowGeometry}" + Fill="{DynamicResource {x:Static themes:ResourceKeys.GlyphNormalForegroundKey}}" + SnapsToDevicePixels="True" + HorizontalAlignment="Center" + VerticalAlignment="Center" + Focusable="False" /> + </DataTemplate> + <DataTemplate x:Key="IncreaseGlyphDisabledKey"> + <Path Width="9" + Height="5" + Data="{StaticResource UpArrowGeometry}" + Fill="{DynamicResource {x:Static themes:ResourceKeys.GlyphDisabledForegroundKey}}" + SnapsToDevicePixels="True" + HorizontalAlignment="Center" + VerticalAlignment="Center" + Focusable="False" /> + </DataTemplate> + + <DataTemplate x:Key="DecreaseGlyphNormalKey"> + <Path Width="9" + Height="5" + Data="{StaticResource DownArrowGeometry}" + Fill="{DynamicResource {x:Static themes:ResourceKeys.GlyphNormalForegroundKey}}" + SnapsToDevicePixels="True" + HorizontalAlignment="Center" + VerticalAlignment="Center" + Focusable="False" /> + </DataTemplate> + + <DataTemplate x:Key="DecreaseGlyphDisabledKey"> + <Path Width="9" + Height="5" + Data="{StaticResource DownArrowGeometry}" + Fill="{DynamicResource {x:Static themes:ResourceKeys.GlyphDisabledForegroundKey}}" + SnapsToDevicePixels="True" + HorizontalAlignment="Center" + VerticalAlignment="Center" + Focusable="False" /> + </DataTemplate> + +</ResourceDictionary> diff --git a/Software/Visual_Studio/Tango.ColorPicker/WindowColors.cs b/Software/Visual_Studio/Tango.ColorPicker/WindowColors.cs new file mode 100644 index 000000000..b5e505915 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/WindowColors.cs @@ -0,0 +1,126 @@ +/************************************************************************************* + + Extended WPF Toolkit + + Copyright (C) 2007-2013 Xceed Software Inc. + + This program is provided to you under the terms of the Microsoft Public + License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license + + For more features, controls, and fast professional support, + pick up the Plus Edition at http://xceed.com/wpf_toolkit + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + ***********************************************************************************/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Media; + +namespace Tango.ColorPicker.Core.Media +{ + /// <summary> + /// Contains system colors and configurations that can be used by the control themes. + /// + /// Mainly extracted from the registry because theses values are not exposed by the standard .NET API. + /// </summary> + internal static class WindowColors + { + private static Color? _colorizationMode; + private static bool? _colorizationOpaqueBlend; + + /// <summary> + /// Relative to the \HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor Registry key. + /// + /// Gets the window chrome color. + /// </summary> + public static Color ColorizationColor + { + get + { + if( _colorizationMode.HasValue ) + return _colorizationMode.Value; + + try + { + _colorizationMode = WindowColors.GetDWMColorValue( "ColorizationColor" ); + } + catch + { + // If for any reason (for example, a SecurityException for XBAP apps) + // we cannot read the value in the registry, fall back on some color. + _colorizationMode = Color.FromArgb(255, 175, 175, 175); + } + + return _colorizationMode.Value; + } + } + + /// <summary> + /// Relative to the \HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationOpaqueBlend Registry key: + /// + /// Gets whether transparency is disabled. + /// + /// Returns true if transparency is disabled; false otherwise. + /// </summary> + public static bool ColorizationOpaqueBlend + { + get + { + if( _colorizationOpaqueBlend.HasValue ) + return _colorizationOpaqueBlend.Value; + + try + { + _colorizationOpaqueBlend = WindowColors.GetDWMBoolValue( "ColorizationOpaqueBlend" ); + } + catch + { + // If for any reason (for example, a SecurityException for XBAP apps) + // we cannot read the value in the registry, fall back on some color. + _colorizationOpaqueBlend = false; + } + + return _colorizationOpaqueBlend.Value; + } + } + + private static int GetDWMIntValue( string keyName ) + { + // This value is not accessible throught the standard WPF API. + // We must dig into the registry to get the value. + var curUser = Microsoft.Win32.Registry.CurrentUser; + var subKey = curUser.CreateSubKey( + @"Software\Microsoft\Windows\DWM", + Microsoft.Win32.RegistryKeyPermissionCheck.ReadSubTree +#if VS2008 + ); +#else + ,Microsoft.Win32.RegistryOptions.None ); +#endif + return ( int )subKey.GetValue( keyName ); + } + + private static Color GetDWMColorValue( string keyName ) + { + int value = WindowColors.GetDWMIntValue( keyName ); + byte[] bytes = BitConverter.GetBytes( value ); + return new Color() + { + B = bytes[ 0 ], + G = bytes[ 1 ], + R = bytes[ 2 ], + A = 255 + }; + } + + private static bool GetDWMBoolValue( string keyName ) + { + int value = WindowColors.GetDWMIntValue( keyName ); + return ( value != 0 ); + } + } +} diff --git a/Software/Visual_Studio/Tango.ColorPicker/WindowControl.cs b/Software/Visual_Studio/Tango.ColorPicker/WindowControl.cs new file mode 100644 index 000000000..371e02ed3 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/WindowControl.cs @@ -0,0 +1,834 @@ +/************************************************************************************* + + Extended WPF Toolkit + + Copyright (C) 2007-2013 Xceed Software Inc. + + This program is provided to you under the terms of the Microsoft Public + License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license + + For more features, controls, and fast professional support, + pick up the Plus Edition at http://xceed.com/wpf_toolkit + + Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids + + ***********************************************************************************/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Controls; +using System.Windows; +using System.Windows.Media; +using System.Windows.Controls.Primitives; +using System.Windows.Input; +using System.IO; +using Tango.ColorPicker.Core; +using System.ComponentModel; + +namespace Tango.ColorPicker.Primitives +{ + [TemplatePart(Name = PART_HeaderThumb, Type = typeof(Thumb))] + [TemplatePart(Name = PART_Icon, Type = typeof(Image))] + [TemplatePart(Name = PART_CloseButton, Type = typeof(Button))] + [TemplatePart(Name = PART_ToolWindowCloseButton, Type = typeof(Button))] + [TemplatePart(Name = PART_BlockMouseInputsBorder, Type = typeof(Border))] + [TemplatePart(Name = PART_HeaderGrid, Type = typeof(Grid))] + internal class WindowControl : ContentControl + { + public static readonly ComponentResourceKey DefaultCloseButtonStyleKey = new ComponentResourceKey(typeof(WindowControl), "DefaultCloseButtonStyle"); + + private const string PART_HeaderThumb = "PART_HeaderThumb"; + private const string PART_Icon = "PART_Icon"; + private const string PART_CloseButton = "PART_CloseButton"; + private const string PART_ToolWindowCloseButton = "PART_ToolWindowCloseButton"; + private const string PART_BlockMouseInputsBorder = "PART_BlockMouseInputsBorder"; + private const string PART_HeaderGrid = "PART_HeaderGrid"; + + #region Members + + private Thumb _headerThumb; + private Image _icon; + private Button _closeButton; + private Button _windowToolboxCloseButton; + private bool _setIsActiveInternal; + internal Border _windowBlockMouseInputsPanel; + + #endregion + + #region Constructors + + static WindowControl() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(WindowControl), new FrameworkPropertyMetadata(typeof(WindowControl))); + } + + public WindowControl() + { + } + + #endregion //Constructors + + #region Dependency Properties + + #region Public DP + + #region Caption + + public static readonly DependencyProperty CaptionProperty = DependencyProperty.Register("Caption", typeof(string), typeof(WindowControl), new UIPropertyMetadata(String.Empty)); + public string Caption + { + get + { + return (string)GetValue(CaptionProperty); + } + set + { + SetValue(CaptionProperty, value); + } + } + + #endregion //Caption + + #region CaptionFontSize + + public static readonly DependencyProperty CaptionFontSizeProperty = DependencyProperty.Register("CaptionFontSize", typeof(double), typeof(WindowControl), new UIPropertyMetadata(15d)); + public double CaptionFontSize + { + get + { + return (double)GetValue(CaptionFontSizeProperty); + } + set + { + SetValue(CaptionFontSizeProperty, value); + } + } + + #endregion //CaptionFontSize + + #region CaptionForeground + + public static readonly DependencyProperty CaptionForegroundProperty = DependencyProperty.Register("CaptionForeground", typeof(Brush), typeof(WindowControl), new UIPropertyMetadata(null)); + public Brush CaptionForeground + { + get + { + return (Brush)GetValue(CaptionForegroundProperty); + } + set + { + SetValue(CaptionForegroundProperty, value); + } + } + + #endregion //CaptionForeground + + #region CaptionShadowBrush + + public static readonly DependencyProperty CaptionShadowBrushProperty = DependencyProperty.Register("CaptionShadowBrush", typeof(Brush), typeof(WindowControl), new UIPropertyMetadata(new SolidColorBrush(Color.FromArgb(179, 255, 255, 255)))); + public Brush CaptionShadowBrush + { + get + { + return (Brush)GetValue(CaptionShadowBrushProperty); + } + set + { + SetValue(CaptionShadowBrushProperty, value); + } + } + + #endregion //CaptionShadowBrush + + #region CaptionIcon + + public static readonly DependencyProperty CaptionIconProperty = DependencyProperty.Register("CaptionIcon", typeof(ImageSource), typeof(WindowControl), new UIPropertyMetadata(null)); + public ImageSource CaptionIcon + { + get + { + return (ImageSource)GetValue(CaptionIconProperty); + } + set + { + SetValue(CaptionIconProperty, value); + } + } + + #endregion //CaptionIcon + + #region CloseButtonStyle + + public static readonly DependencyProperty CloseButtonStyleProperty = DependencyProperty.Register("CloseButtonStyle", typeof(Style), typeof(WindowControl), new UIPropertyMetadata(null)); + public Style CloseButtonStyle + { + get + { + return (Style)GetValue(CloseButtonStyleProperty); + } + set + { + SetValue(CloseButtonStyleProperty, value); + } + } + + #endregion //CloseButtonStyle + + #region CloseButtonVisibility + + public static readonly DependencyProperty CloseButtonVisibilityProperty = DependencyProperty.Register("CloseButtonVisibility", typeof(Visibility), typeof(WindowControl), new PropertyMetadata(Visibility.Visible, null, OnCoerceCloseButtonVisibility)); + public Visibility CloseButtonVisibility + { + get + { + return (Visibility)GetValue(CloseButtonVisibilityProperty); + } + set + { + SetValue(CloseButtonVisibilityProperty, value); + } + } + + private static object OnCoerceCloseButtonVisibility(DependencyObject d, object basevalue) + { + if (basevalue == DependencyProperty.UnsetValue) + return basevalue; + + WindowControl windowControl = d as WindowControl; + if (windowControl == null) + return basevalue; + return windowControl.OnCoerceCloseButtonVisibility((Visibility)basevalue); + } + + protected virtual object OnCoerceCloseButtonVisibility(Visibility newValue) + { + return newValue; + } + + #endregion //CloseButtonVisibility + + #region IsActive + + public static readonly DependencyProperty IsActiveProperty = DependencyProperty.Register("IsActive", typeof(bool), typeof(WindowControl), new UIPropertyMetadata(true, null, OnCoerceIsActive)); + public bool IsActive + { + get + { + return (bool)GetValue(IsActiveProperty); + } + set + { + SetValue(IsActiveProperty, value); + } + } + + private static object OnCoerceIsActive(DependencyObject d, object basevalue) + { + WindowControl w = d as WindowControl; + if (w != null && !w._setIsActiveInternal && !w.AllowPublicIsActiveChange) + throw new InvalidOperationException("Cannot set IsActive directly. This is handled by the underlying system"); + + return basevalue; + } + + internal void SetIsActiveInternal(bool isActive) + { + _setIsActiveInternal = true; + this.IsActive = isActive; + _setIsActiveInternal = false; + } + + #endregion //IsActive + + + + + + + + + + #region Left + + public static readonly DependencyProperty LeftProperty = DependencyProperty.Register("Left", typeof(double), typeof(WindowControl), new PropertyMetadata(0.0, new PropertyChangedCallback(OnLeftPropertyChanged), OnCoerceLeft)); + public double Left + { + get + { + return (double)GetValue(LeftProperty); + } + set + { + SetValue(LeftProperty, value); + } + } + + private static object OnCoerceLeft(DependencyObject d, object basevalue) + { + if (basevalue == DependencyProperty.UnsetValue) + return basevalue; + + var windowControl = (WindowControl)d; + if (windowControl == null) + return basevalue; + + return windowControl.OnCoerceLeft(basevalue); + } + + private object OnCoerceLeft(object newValue) + { + var value = (double)newValue; + if (object.Equals(value, double.NaN)) + return 0.0; + + return newValue; + } + + private static void OnLeftPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) + { + WindowControl windowControl = obj as WindowControl; + if (windowControl != null) + windowControl.OnLeftPropertyChanged((double)e.OldValue, (double)e.NewValue); + } + + internal event EventHandler<EventArgs> LeftChanged; + + protected virtual void OnLeftPropertyChanged(double oldValue, double newValue) + { + EventHandler<EventArgs> handler = LeftChanged; + if (handler != null) + { + handler(this, EventArgs.Empty); + } + } + + #endregion //Left + + #region Top + + public static readonly DependencyProperty TopProperty = DependencyProperty.Register("Top", typeof(double), typeof(WindowControl), new PropertyMetadata(0.0, new PropertyChangedCallback(OnTopPropertyChanged), OnCoerceTop)); + public double Top + { + get + { + return (double)GetValue(TopProperty); + } + set + { + SetValue(TopProperty, value); + } + } + + private static object OnCoerceTop(DependencyObject d, object basevalue) + { + if (basevalue == DependencyProperty.UnsetValue) + return basevalue; + + var windowControl = (WindowControl)d; + if (windowControl == null) + return basevalue; + + return windowControl.OnCoerceTop(basevalue); + } + + private object OnCoerceTop(object newValue) + { + var value = (double)newValue; + if (object.Equals(value, double.NaN)) + return 0.0; + + return newValue; + } + + private static void OnTopPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) + { + WindowControl windowControl = obj as WindowControl; + if (windowControl != null) + windowControl.OnTopPropertyChanged((double)e.OldValue, (double)e.NewValue); + } + + internal event EventHandler<EventArgs> TopChanged; + + protected virtual void OnTopPropertyChanged(double oldValue, double newValue) + { + EventHandler<EventArgs> handler = TopChanged; + if (handler != null) + { + handler(this, EventArgs.Empty); + } + } + + #endregion //TopProperty + + + + + + + + + + + + + + + + + + #region WindowBackground + + public static readonly DependencyProperty WindowBackgroundProperty = DependencyProperty.Register("WindowBackground", typeof(Brush), typeof(WindowControl), new PropertyMetadata(null)); + public Brush WindowBackground + { + get + { + return (Brush)GetValue(WindowBackgroundProperty); + } + set + { + SetValue(WindowBackgroundProperty, value); + } + } + + #endregion // WindowBackground + + #region WindowBorderBrush + + public static readonly DependencyProperty WindowBorderBrushProperty = DependencyProperty.Register("WindowBorderBrush", typeof(Brush), typeof(WindowControl), new PropertyMetadata(null)); + public Brush WindowBorderBrush + { + get + { + return (Brush)GetValue(WindowBorderBrushProperty); + } + set + { + SetValue(WindowBorderBrushProperty, value); + } + } + + #endregion //WindowBorderBrush + + #region WindowBorderThickness + + public static readonly DependencyProperty WindowBorderThicknessProperty = DependencyProperty.Register("WindowBorderThickness", typeof(Thickness), typeof(WindowControl), new PropertyMetadata(new Thickness(0))); + public Thickness WindowBorderThickness + { + get + { + return (Thickness)GetValue(WindowBorderThicknessProperty); + } + set + { + SetValue(WindowBorderThicknessProperty, value); + } + } + + #endregion //WindowBorderThickness + + #region WindowInactiveBackground + + public static readonly DependencyProperty WindowInactiveBackgroundProperty = DependencyProperty.Register("WindowInactiveBackground", typeof(Brush), typeof(WindowControl), new PropertyMetadata(null)); + public Brush WindowInactiveBackground + { + get + { + return (Brush)GetValue(WindowInactiveBackgroundProperty); + } + set + { + SetValue(WindowInactiveBackgroundProperty, value); + } + } + + #endregion // WindowInactiveBackground + + #region WindowOpacity + + public static readonly DependencyProperty WindowOpacityProperty = DependencyProperty.Register("WindowOpacity", typeof(double), typeof(WindowControl), new PropertyMetadata(1d)); + public double WindowOpacity + { + get + { + return (double)GetValue(WindowOpacityProperty); + } + set + { + SetValue(WindowOpacityProperty, value); + } + } + + #endregion //WindowOpacity + + #region WindowStyle + + public static readonly DependencyProperty WindowStyleProperty = DependencyProperty.Register("WindowStyle", typeof(WindowStyle), typeof(WindowControl), new PropertyMetadata(WindowStyle.SingleBorderWindow, null, OnCoerceWindowStyle)); + public WindowStyle WindowStyle + { + get + { + return (WindowStyle)GetValue(WindowStyleProperty); + } + set + { + SetValue(WindowStyleProperty, value); + } + } + + private static object OnCoerceWindowStyle(DependencyObject d, object basevalue) + { + if (basevalue == DependencyProperty.UnsetValue) + return basevalue; + + WindowControl windowControl = d as WindowControl; + if (windowControl == null) + return basevalue; + return windowControl.OnCoerceWindowStyle((WindowStyle)basevalue); + } + + protected virtual object OnCoerceWindowStyle(WindowStyle newValue) + { + return newValue; + } + + private static void OnWindowStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + WindowControl window = (WindowControl)d; + if (window != null) + window.OnWindowStyleChanged((WindowStyle)e.OldValue, (WindowStyle)e.NewValue); + } + + protected virtual void OnWindowStyleChanged(WindowStyle oldValue, WindowStyle newValue) + { + } + + #endregion //WindowStyle + + #region WindowThickness + + public static readonly DependencyProperty WindowThicknessProperty = DependencyProperty.Register("WindowThickness", typeof(Thickness), typeof(WindowControl), + new PropertyMetadata(new Thickness(SystemParameters.ResizeFrameVerticalBorderWidth - 3, + SystemParameters.ResizeFrameHorizontalBorderHeight - 3, + SystemParameters.ResizeFrameVerticalBorderWidth - 3, + SystemParameters.ResizeFrameHorizontalBorderHeight - 3))); + public Thickness WindowThickness + { + get + { + return (Thickness)GetValue(WindowThicknessProperty); + } + set + { + SetValue(WindowThicknessProperty, value); + } + } + + #endregion //WindowThickness + + #endregion //Public DP + + #endregion //Dependency Properties + + #region Internal Properties + + internal bool IsStartupPositionInitialized + { + get; + set; + } + + #region IsBlockMouseInputsPanelActive (Internal) + + internal bool IsBlockMouseInputsPanelActive + { + get + { + return _IsBlockMouseInputsPanelActive; + } + set + { + if (value != _IsBlockMouseInputsPanelActive) + { + _IsBlockMouseInputsPanelActive = value; + this.UpdateBlockMouseInputsPanel(); + } + } + } + + private bool _IsBlockMouseInputsPanelActive; + + #endregion + + internal virtual bool AllowPublicIsActiveChange + { + get { return true; } + } + + + #endregion //Internal Properties + + #region Base Class Overrides + + public override void OnApplyTemplate() + { + base.OnApplyTemplate(); + + if (_headerThumb != null) + { + _headerThumb.PreviewMouseLeftButtonDown -= new MouseButtonEventHandler(this.HeaderPreviewMouseLeftButtonDown); + _headerThumb.PreviewMouseRightButtonDown -= new MouseButtonEventHandler(this.HeaderPreviewMouseRightButtonDown); + _headerThumb.DragDelta -= new DragDeltaEventHandler(this.HeaderThumbDragDelta); + } + _headerThumb = this.Template.FindName(PART_HeaderThumb, this) as Thumb; + if (_headerThumb != null) + { + _headerThumb.PreviewMouseLeftButtonDown += new MouseButtonEventHandler(this.HeaderPreviewMouseLeftButtonDown); + _headerThumb.PreviewMouseRightButtonDown += new MouseButtonEventHandler(this.HeaderPreviewMouseRightButtonDown); + _headerThumb.DragDelta += new DragDeltaEventHandler(this.HeaderThumbDragDelta); + } + + if (_icon != null) + { + _icon.MouseLeftButtonDown -= new MouseButtonEventHandler(this.IconMouseLeftButtonDown); + } + _icon = this.Template.FindName(PART_Icon, this) as Image; + if (_icon != null) + { + _icon.MouseLeftButtonDown += new MouseButtonEventHandler(this.IconMouseLeftButtonDown); + } + + if (_closeButton != null) + { + _closeButton.Click -= new RoutedEventHandler(this.Close); + } + _closeButton = this.Template.FindName(PART_CloseButton, this) as Button; + if (_closeButton != null) + { + _closeButton.Click += new RoutedEventHandler(this.Close); + } + + if (_windowToolboxCloseButton != null) + { + _windowToolboxCloseButton.Click -= new RoutedEventHandler(this.Close); + } + _windowToolboxCloseButton = this.Template.FindName(PART_ToolWindowCloseButton, this) as Button; + if (_windowToolboxCloseButton != null) + { + _windowToolboxCloseButton.Click += new RoutedEventHandler(this.Close); + } + + _windowBlockMouseInputsPanel = this.Template.FindName(PART_BlockMouseInputsBorder, this) as Border; + this.UpdateBlockMouseInputsPanel(); + + + + } + + #endregion //Base Class Overrides + + #region Events + + #region HeaderMouseLeftButtonClickedEvent + + public static readonly RoutedEvent HeaderMouseLeftButtonClickedEvent = EventManager.RegisterRoutedEvent("HeaderMouseLeftButtonClicked", RoutingStrategy.Bubble, typeof(MouseButtonEventHandler), typeof(WindowControl)); + public event MouseButtonEventHandler HeaderMouseLeftButtonClicked + { + add + { + AddHandler(HeaderMouseLeftButtonClickedEvent, value); + } + remove + { + RemoveHandler(HeaderMouseLeftButtonClickedEvent, value); + } + } + + #endregion //HeaderMouseLeftButtonClickedEvent + + #region HeaderMouseRightButtonClickedEvent + + public static readonly RoutedEvent HeaderMouseRightButtonClickedEvent = EventManager.RegisterRoutedEvent("HeaderMouseRightButtonClicked", RoutingStrategy.Bubble, typeof(MouseButtonEventHandler), typeof(WindowControl)); + public event MouseButtonEventHandler HeaderMouseRightButtonClicked + { + add + { + AddHandler(HeaderMouseRightButtonClickedEvent, value); + } + remove + { + RemoveHandler(HeaderMouseRightButtonClickedEvent, value); + } + } + + #endregion //HeaderMouseRightButtonClickedEvent + + #region HeaderMouseLeftButtonDoubleClickedEvent + + public static readonly RoutedEvent HeaderMouseLeftButtonDoubleClickedEvent = EventManager.RegisterRoutedEvent("HeaderMouseLeftButtonDoubleClicked", RoutingStrategy.Bubble, typeof(MouseButtonEventHandler), typeof(WindowControl)); + public event MouseButtonEventHandler HeaderMouseLeftButtonDoubleClicked + { + add + { + AddHandler(HeaderMouseLeftButtonDoubleClickedEvent, value); + } + remove + { + RemoveHandler(HeaderMouseLeftButtonDoubleClickedEvent, value); + } + } + + #endregion //HeaderMouseLeftButtonDoubleClickedEvent + + #region HeaderDragDeltaEvent + + public static readonly RoutedEvent HeaderDragDeltaEvent = EventManager.RegisterRoutedEvent("HeaderDragDelta", RoutingStrategy.Bubble, typeof(DragDeltaEventHandler), typeof(WindowControl)); + public event DragDeltaEventHandler HeaderDragDelta + { + add + { + AddHandler(HeaderDragDeltaEvent, value); + } + remove + { + RemoveHandler(HeaderDragDeltaEvent, value); + } + } + + #endregion //HeaderDragDeltaEvent + + #region HeaderIconClickedEvent + + public static readonly RoutedEvent HeaderIconClickedEvent = EventManager.RegisterRoutedEvent("HeaderIconClicked", RoutingStrategy.Bubble, typeof(MouseButtonEventHandler), typeof(WindowControl)); + public event MouseButtonEventHandler HeaderIconClicked + { + add + { + AddHandler(HeaderIconClickedEvent, value); + } + remove + { + RemoveHandler(HeaderIconClickedEvent, value); + } + } + + #endregion //HeaderIconClickedEvent + + #region HeaderIconDoubleClickedEvent + + public static readonly RoutedEvent HeaderIconDoubleClickedEvent = EventManager.RegisterRoutedEvent("HeaderIconDoubleClicked", RoutingStrategy.Bubble, typeof(MouseButtonEventHandler), typeof(WindowControl)); + public event MouseButtonEventHandler HeaderIconDoubleClicked + { + add + { + AddHandler(HeaderIconDoubleClickedEvent, value); + } + remove + { + RemoveHandler(HeaderIconDoubleClickedEvent, value); + } + } + + #endregion //HeaderIconDoubleClickedEvent + + #region CloseButtonClickedEvent + + public static readonly RoutedEvent CloseButtonClickedEvent = EventManager.RegisterRoutedEvent("CloseButtonClicked", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(WindowControl)); + public event RoutedEventHandler CloseButtonClicked + { + add + { + AddHandler(CloseButtonClickedEvent, value); + } + remove + { + RemoveHandler(CloseButtonClickedEvent, value); + } + } + + #endregion //CloseButtonClickedEvent + + + + + + + + + + + #endregion //Events + + #region Event Handler + + private void HeaderPreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) + { + + MouseButtonEventArgs args = new MouseButtonEventArgs(Mouse.PrimaryDevice, 0, MouseButton.Left); + args.RoutedEvent = (e.ClickCount == 2) ? HeaderMouseLeftButtonDoubleClickedEvent : HeaderMouseLeftButtonClickedEvent; + args.Source = this; + this.RaiseEvent(args); + } + + private void HeaderPreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e) + { + MouseButtonEventArgs args = new MouseButtonEventArgs(Mouse.PrimaryDevice, 0, MouseButton.Right); + args.RoutedEvent = HeaderMouseRightButtonClickedEvent; + args.Source = this; + this.RaiseEvent(args); + } + + private void HeaderThumbDragDelta(object sender, DragDeltaEventArgs e) + { + DragDeltaEventArgs args = new DragDeltaEventArgs(e.HorizontalChange, e.VerticalChange); + args.RoutedEvent = HeaderDragDeltaEvent; + args.Source = this; + this.RaiseEvent(args); + } + + private void IconMouseLeftButtonDown(object sender, MouseButtonEventArgs e) + { + MouseButtonEventArgs args = new MouseButtonEventArgs(Mouse.PrimaryDevice, 0, MouseButton.Left); + args.RoutedEvent = (e.ClickCount == 2) ? HeaderIconDoubleClickedEvent : HeaderIconClickedEvent; + args.Source = this; + this.RaiseEvent(args); + } + + private void Close(object sender, RoutedEventArgs e) + { + this.RaiseEvent(new RoutedEventArgs(CloseButtonClickedEvent, this)); + } + + + + + #endregion // Event Handler + + #region Internal Methods + + internal virtual void UpdateBlockMouseInputsPanel() + { + if (_windowBlockMouseInputsPanel != null) + { + _windowBlockMouseInputsPanel.Visibility = this.IsBlockMouseInputsPanelActive ? Visibility.Visible : Visibility.Collapsed; + } + } + + internal double GetHeaderHeight() + { + Grid headerGrid = this.Template.FindName(PART_HeaderGrid, this) as Grid; + if (headerGrid != null) + return headerGrid.ActualHeight; + return 0; + } + + #endregion + + #region Private Methods + + + #endregion //Private Methods + } +} diff --git a/Software/Visual_Studio/Tango.ColorPicker/packages.config b/Software/Visual_Studio/Tango.ColorPicker/packages.config new file mode 100644 index 000000000..c42222162 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPicker/packages.config @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="ControlzEx" version="3.0.2.4" targetFramework="net46" /> + <package id="MahApps.Metro" version="1.5.0" targetFramework="net46" /> +</packages>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Core/Cryptography/ICryptographer.cs b/Software/Visual_Studio/Tango.Core/Cryptography/ICryptographer.cs new file mode 100644 index 000000000..a5c9ea923 --- /dev/null +++ b/Software/Visual_Studio/Tango.Core/Cryptography/ICryptographer.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Core.Cryptography +{ + public interface ICryptographer + { + String Encrypt(String text); + String Decrypt(String text); + String Encrypt(String text, String key); + String Decrypt(String text, String key); + } +} diff --git a/Software/Visual_Studio/Tango.Core/Cryptography/Rfc2898Cryptographer.cs b/Software/Visual_Studio/Tango.Core/Cryptography/Rfc2898Cryptographer.cs new file mode 100644 index 000000000..9d369d323 --- /dev/null +++ b/Software/Visual_Studio/Tango.Core/Cryptography/Rfc2898Cryptographer.cs @@ -0,0 +1,70 @@ +using System.IO; +using System.Text; +using System.Security.Cryptography; +using System; +using SimpleValidator.Extensions; + +namespace Tango.Core.Cryptography +{ + public class Rfc2898Cryptographer : ICryptographer + { + public string Decrypt(string text) + { + return Decrypt(text, Properties.Resources.EncryptionPassword); + } + + public string Decrypt(string text, string key) + { + if (text.IsNullOrWhiteSpace()) return text; + + string EncryptionKey = Properties.Resources.EncryptionPassword; + text = text.Replace(" ", "+"); + byte[] cipherBytes = Convert.FromBase64String(text); + using (Aes encryptor = Aes.Create()) + { + Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes(EncryptionKey, new byte[] { 0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76 }); + encryptor.Key = pdb.GetBytes(32); + encryptor.IV = pdb.GetBytes(16); + using (MemoryStream ms = new MemoryStream()) + { + using (CryptoStream cs = new CryptoStream(ms, encryptor.CreateDecryptor(), CryptoStreamMode.Write)) + { + cs.Write(cipherBytes, 0, cipherBytes.Length); + cs.Close(); + } + text = Encoding.Unicode.GetString(ms.ToArray()); + } + } + return text; + } + + public string Encrypt(string text) + { + return Encrypt(text, Properties.Resources.EncryptionPassword); + } + + public string Encrypt(string text, string key) + { + if (text.IsNullOrWhiteSpace()) return text; + + string EncryptionKey = key; + byte[] clearBytes = Encoding.Unicode.GetBytes(text); + using (Aes encryptor = Aes.Create()) + { + Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes(EncryptionKey, new byte[] { 0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76 }); + encryptor.Key = pdb.GetBytes(32); + encryptor.IV = pdb.GetBytes(16); + using (MemoryStream ms = new MemoryStream()) + { + using (CryptoStream cs = new CryptoStream(ms, encryptor.CreateEncryptor(), CryptoStreamMode.Write)) + { + cs.Write(clearBytes, 0, clearBytes.Length); + cs.Close(); + } + text = Convert.ToBase64String(ms.ToArray()); + } + } + return text; + } + } +} diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/IServiceLocatorExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/IServiceLocatorExtensions.cs new file mode 100644 index 000000000..d39cf478f --- /dev/null +++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/IServiceLocatorExtensions.cs @@ -0,0 +1,22 @@ +using Microsoft.Practices.ServiceLocation; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +public static class IServiceLocatorExtensions +{ + public static List<Object> GetAllInstances(this IServiceLocator locator) + { + var dictionaries = locator.GetType().GetField("_instancesRegistry", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(locator) as Dictionary<Type, Dictionary<string, object>>; + var instances = dictionaries.SelectMany(x => x.Value).Select(x => x.Value).ToList(); + return instances; + } + + public static List<T> GetAllInstancesByBase<T>(this IServiceLocator locator) + { + return locator.GetAllInstances().Where(x => typeof(T).IsAssignableFrom(x.GetType())).Select(x => (T)x).ToList(); + } +} diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs index 3b46ab7cc..544b4a1da 100644 --- a/Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs +++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs @@ -56,7 +56,7 @@ public static class StringExtensions /// </summary> /// <param name="text">The text.</param> /// <returns></returns> - public static String Singularize(this String text) + public static String SingularizeMVC(this String text) { var serv = PluralizationService.CreateService(new System.Globalization.CultureInfo("en-us")); return serv.Singularize(text); @@ -67,7 +67,7 @@ public static class StringExtensions /// </summary> /// <param name="text">The text.</param> /// <returns></returns> - public static String Pluralize(this String text) + public static String PluralizeMVC(this String text) { var serv = PluralizationService.CreateService(new System.Globalization.CultureInfo("en-us")); return serv.Pluralize(text); diff --git a/Software/Visual_Studio/Tango.Core/Helpers/ColorHelper.cs b/Software/Visual_Studio/Tango.Core/Helpers/ColorHelper.cs new file mode 100644 index 000000000..c88d5aead --- /dev/null +++ b/Software/Visual_Studio/Tango.Core/Helpers/ColorHelper.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media; + +namespace Tango.Core.Helpers +{ + /// <summary> + /// Contains several color helper methods. + /// </summary> + public static class ColorHelper + { + /// <summary> + /// Converts a color to integer. + /// </summary> + /// <param name="color">The color.</param> + /// <returns></returns> + public static int ColorToInteger(Color color) + { + return (int)((color.A << 24) | (color.R << 16) | + (color.G << 8) | (color.B << 0)); + } + + /// <summary> + /// Converts an integer to color. + /// </summary> + /// <param name="integer">The integer.</param> + /// <returns></returns> + public static Color IntegerToColor(int integer) + { + byte a = (byte)(integer >> 24); + byte r = (byte)(integer >> 16); + byte g = (byte)(integer >> 8); + byte b = (byte)(integer >> 0); + return Color.FromArgb(a, r, g, b); + } + } +} diff --git a/Software/Visual_Studio/Tango.Core/Helpers/ThreadsHelper.cs b/Software/Visual_Studio/Tango.Core/Helpers/ThreadsHelper.cs new file mode 100644 index 000000000..5f140d344 --- /dev/null +++ b/Software/Visual_Studio/Tango.Core/Helpers/ThreadsHelper.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Threading; + +namespace Tango.Core.Helpers +{ + public static class ThreadsHelper + { + public static void InvokeUI(Action action) + { + Dispatcher.CurrentDispatcher.BeginInvoke(action); + } + + public static void InvokeUINow(Action action) + { + Dispatcher.CurrentDispatcher.Invoke(action); + } + } +} diff --git a/Software/Visual_Studio/Tango.Core/Properties/Resources.Designer.cs b/Software/Visual_Studio/Tango.Core/Properties/Resources.Designer.cs new file mode 100644 index 000000000..4f47c533a --- /dev/null +++ b/Software/Visual_Studio/Tango.Core/Properties/Resources.Designer.cs @@ -0,0 +1,72 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace Tango.Core.Properties { + using System; + + + /// <summary> + /// A strongly-typed resource class, for looking up localized strings, etc. + /// </summary> + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// <summary> + /// Returns the cached ResourceManager instance used by this class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.Core.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// <summary> + /// Looks up a localized string similar to twineAa123456. + /// </summary> + internal static string EncryptionPassword { + get { + return ResourceManager.GetString("EncryptionPassword", resourceCulture); + } + } + } +} diff --git a/Software/Visual_Studio/Tango.Core/Properties/Resources.resx b/Software/Visual_Studio/Tango.Core/Properties/Resources.resx new file mode 100644 index 000000000..dedc8ed88 --- /dev/null +++ b/Software/Visual_Studio/Tango.Core/Properties/Resources.resx @@ -0,0 +1,124 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="EncryptionPassword" xml:space="preserve"> + <value>twineAa123456</value> + <comment>Standard password for cryptography</comment> + </data> +</root>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Core/Software - Shortcut.lnk b/Software/Visual_Studio/Tango.Core/Software - Shortcut.lnk Binary files differnew file mode 100644 index 000000000..70db0cc38 --- /dev/null +++ b/Software/Visual_Studio/Tango.Core/Software - Shortcut.lnk diff --git a/Software/Visual_Studio/Tango.Core/Tango.Core.csproj b/Software/Visual_Studio/Tango.Core/Tango.Core.csproj index fd3eeddf9..59afc2931 100644 --- a/Software/Visual_Studio/Tango.Core/Tango.Core.csproj +++ b/Software/Visual_Studio/Tango.Core/Tango.Core.csproj @@ -31,15 +31,34 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> + <Reference Include="GalaSoft.MvvmLight, Version=5.3.0.19026, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL"> + <HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll</HintPath> + </Reference> + <Reference Include="GalaSoft.MvvmLight.Extras, Version=5.3.0.19032, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL"> + <HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath> + </Reference> + <Reference Include="GalaSoft.MvvmLight.Platform, Version=5.3.0.19032, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL"> + <HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath> + </Reference> <Reference Include="Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> <HintPath>..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll</HintPath> </Reference> + <Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath> + </Reference> <Reference Include="PresentationCore" /> <Reference Include="PresentationFramework" /> + <Reference Include="SimpleValidator, Version=0.6.1.0, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\packages\SimpleValidator.0.6.1.0\lib\net40\SimpleValidator.dll</HintPath> + </Reference> <Reference Include="System" /> <Reference Include="System.Core" /> <Reference Include="System.Data.Entity.Design" /> <Reference Include="System.Windows" /> + <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\System.Windows.Interactivity.dll</HintPath> + <Private>True</Private> + </Reference> <Reference Include="System.Xaml" /> <Reference Include="System.Xml.Linq" /> <Reference Include="System.Data.DataSetExtensions" /> @@ -55,6 +74,8 @@ </Compile> <Compile Include="Commands\RelayCommand.cs" /> <Compile Include="ConcurrentList.cs" /> + <Compile Include="Cryptography\ICryptographer.cs" /> + <Compile Include="Cryptography\Rfc2898Cryptographer.cs" /> <Compile Include="ExtendedObject.cs" /> <Compile Include="ExtensionMethods\DateTimeExtensions.cs" /> <Compile Include="ExtensionMethods\DependencyObjectExtensions.cs" /> @@ -64,15 +85,24 @@ <Compile Include="ExtensionMethods\IParameterizedExtensions.cs" /> <Compile Include="ExtensionMethods\ObjectExtensions.cs" /> <Compile Include="ExtensionMethods\ReflectionExtensions.cs" /> + <Compile Include="ExtensionMethods\IServiceLocatorExtensions.cs" /> <Compile Include="ExtensionMethods\StringExtensions.cs" /> <Compile Include="Helpers\AssemblyHelper.cs" /> + <Compile Include="Helpers\ColorHelper.cs" /> <Compile Include="Helpers\PathHelper.cs" /> + <Compile Include="Helpers\ThreadsHelper.cs" /> <Compile Include="IParameterized.cs" /> <Compile Include="ParameterIgnoreAttribute.cs" /> <Compile Include="ParameterItem.cs" /> <Compile Include="ParameterItemAttribute.cs" /> <Compile Include="ParameterItemMode.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> + <Compile Include="Threading\StaThreadHelper.cs" /> </ItemGroup> <ItemGroup> <None Include="packages.config" /> @@ -83,5 +113,11 @@ <Name>Tango.Serialization</Name> </ProjectReference> </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Properties\Resources.resx"> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + </EmbeddedResource> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Core/Threading/StaThreadHelper.cs b/Software/Visual_Studio/Tango.Core/Threading/StaThreadHelper.cs new file mode 100644 index 000000000..5c1f5b93c --- /dev/null +++ b/Software/Visual_Studio/Tango.Core/Threading/StaThreadHelper.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace Tango.Core.Threading +{ + public static class StaThreadHelper + { + public static void StartStaThread(Action action) + { + Thread thread = new Thread(() => + { + action(); + }); + thread.SetApartmentState(ApartmentState.STA); + thread.IsBackground = true; + thread.Start(); + } + } +} diff --git a/Software/Visual_Studio/Tango.Core/packages.config b/Software/Visual_Studio/Tango.Core/packages.config index e7e6cbade..114eefdba 100644 --- a/Software/Visual_Studio/Tango.Core/packages.config +++ b/Software/Visual_Studio/Tango.Core/packages.config @@ -1,4 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <packages> + <package id="CommonServiceLocator" version="1.3" targetFramework="net46" /> <package id="Google.Protobuf" version="3.4.1" targetFramework="net45" /> + <package id="MvvmLightLibs" version="5.3.0.0" targetFramework="net46" /> + <package id="SimpleValidator" version="0.6.1.0" targetFramework="net46" /> </packages>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.Context.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.Context.cs index 1c639e33d..38ae0a849 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.Context.cs +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.Context.cs @@ -49,7 +49,6 @@ namespace Tango.DAL.Local.DB public virtual DbSet<LIQUID> LIQUIDS { get; set; } public virtual DbSet<LIQUIDS_RMLS> LIQUIDS_RMLS { get; set; } public virtual DbSet<MACHINE_VERSIONS> MACHINE_VERSIONS { get; set; } - public virtual DbSet<MACHINE_VERSIONS_CONFIGURATIONS> MACHINE_VERSIONS_CONFIGURATIONS { get; set; } public virtual DbSet<MACHINE> MACHINES { get; set; } public virtual DbSet<MACHINES_CONFIGURATIONS> MACHINES_CONFIGURATIONS { get; set; } public virtual DbSet<MACHINES_EVENTS> MACHINES_EVENTS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx index 83482b978..bd71d7457 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx @@ -262,18 +262,6 @@ <Property Name="DELETED" Type="bit" Nullable="false" /> <Property Name="VERSION" Type="real" Nullable="false" /> </EntityType> - <EntityType Name="MACHINE_VERSIONS_CONFIGURATIONS"> - <Key> - <PropertyRef Name="ID" /> - </Key> - <Property Name="ID" Type="integer" Nullable="false" /> - <Property Name="GUID" Type="nvarchar" MaxLength="2147483647" Nullable="false" /> - <Property Name="LAST_UPDATED" Type="datetime" Nullable="false" /> - <Property Name="DELETED" Type="bit" Nullable="false" /> - <Property Name="VERSION" Type="real" Nullable="false" /> - <Property Name="MACHINE_VERSION_GUID" Type="nvarchar" MaxLength="2147483647" Nullable="false" /> - <Property Name="CONFIGURATION_GUID" Type="nvarchar" MaxLength="2147483647" Nullable="false" /> - </EntityType> <EntityType Name="MACHINES"> <Key> <PropertyRef Name="ID" /> @@ -482,7 +470,6 @@ <EntitySet Name="LIQUIDS" EntityType="Self.LIQUIDS" store:Type="Tables" /> <EntitySet Name="LIQUIDS_RMLS" EntityType="Self.LIQUIDS_RMLS" store:Type="Tables" /> <EntitySet Name="MACHINE_VERSIONS" EntityType="Self.MACHINE_VERSIONS" store:Type="Tables" /> - <EntitySet Name="MACHINE_VERSIONS_CONFIGURATIONS" EntityType="Self.MACHINE_VERSIONS_CONFIGURATIONS" store:Type="Tables" /> <EntitySet Name="MACHINES" EntityType="Self.MACHINES" store:Type="Tables" /> <EntitySet Name="MACHINES_CONFIGURATIONS" EntityType="Self.MACHINES_CONFIGURATIONS" store:Type="Tables" /> <EntitySet Name="MACHINES_EVENTS" EntityType="Self.MACHINES_EVENTS" store:Type="Tables" /> @@ -528,7 +515,6 @@ <EntitySet Name="LIQUIDS" EntityType="LocalModel.LIQUID" /> <EntitySet Name="LIQUIDS_RMLS" EntityType="LocalModel.LIQUIDS_RMLS" /> <EntitySet Name="MACHINE_VERSIONS" EntityType="LocalModel.MACHINE_VERSIONS" /> - <EntitySet Name="MACHINE_VERSIONS_CONFIGURATIONS" EntityType="LocalModel.MACHINE_VERSIONS_CONFIGURATIONS" /> <EntitySet Name="MACHINES" EntityType="LocalModel.MACHINE" /> <EntitySet Name="MACHINES_CONFIGURATIONS" EntityType="LocalModel.MACHINES_CONFIGURATIONS" /> <EntitySet Name="MACHINES_EVENTS" EntityType="LocalModel.MACHINES_EVENTS" /> @@ -802,18 +788,6 @@ <Property Name="DELETED" Type="Boolean" Nullable="false" /> <Property Name="VERSION" Type="Double" Nullable="false" /> </EntityType> - <EntityType Name="MACHINE_VERSIONS_CONFIGURATIONS"> - <Key> - <PropertyRef Name="ID" /> - </Key> - <Property Name="ID" Type="Int64" Nullable="false" /> - <Property Name="GUID" Type="String" Nullable="false" MaxLength="2147483647" FixedLength="false" Unicode="true" /> - <Property Name="LAST_UPDATED" Type="DateTime" Nullable="false" /> - <Property Name="DELETED" Type="Boolean" Nullable="false" /> - <Property Name="VERSION" Type="Double" Nullable="false" /> - <Property Name="MACHINE_VERSION_GUID" Type="String" Nullable="false" MaxLength="2147483647" FixedLength="false" Unicode="true" /> - <Property Name="CONFIGURATION_GUID" Type="String" Nullable="false" MaxLength="2147483647" FixedLength="false" Unicode="true" /> - </EntityType> <EntityType Name="MACHINE"> <Key> <PropertyRef Name="ID" /> @@ -1284,19 +1258,6 @@ </MappingFragment> </EntityTypeMapping> </EntitySetMapping> - <EntitySetMapping Name="MACHINE_VERSIONS_CONFIGURATIONS"> - <EntityTypeMapping TypeName="LocalModel.MACHINE_VERSIONS_CONFIGURATIONS"> - <MappingFragment StoreEntitySet="MACHINE_VERSIONS_CONFIGURATIONS"> - <ScalarProperty Name="CONFIGURATION_GUID" ColumnName="CONFIGURATION_GUID" /> - <ScalarProperty Name="MACHINE_VERSION_GUID" ColumnName="MACHINE_VERSION_GUID" /> - <ScalarProperty Name="VERSION" ColumnName="VERSION" /> - <ScalarProperty Name="DELETED" ColumnName="DELETED" /> - <ScalarProperty Name="LAST_UPDATED" ColumnName="LAST_UPDATED" /> - <ScalarProperty Name="GUID" ColumnName="GUID" /> - <ScalarProperty Name="ID" ColumnName="ID" /> - </MappingFragment> - </EntityTypeMapping> - </EntitySetMapping> <EntitySetMapping Name="MACHINES"> <EntityTypeMapping TypeName="LocalModel.MACHINE"> <MappingFragment StoreEntitySet="MACHINES"> diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx.diagram index e96c0836c..350983c76 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx.diagram @@ -29,22 +29,21 @@ <EntityTypeShape EntityType="LocalModel.LIQUID" Width="1.5" PointX="4.75" PointY="11.75" /> <EntityTypeShape EntityType="LocalModel.LIQUIDS_RMLS" Width="1.5" PointX="12.75" PointY="0.75" /> <EntityTypeShape EntityType="LocalModel.MACHINE_VERSIONS" Width="1.5" PointX="12.75" PointY="3.75" /> - <EntityTypeShape EntityType="LocalModel.MACHINE_VERSIONS_CONFIGURATIONS" Width="1.5" PointX="12.75" PointY="6.75" /> - <EntityTypeShape EntityType="LocalModel.MACHINE" Width="1.5" PointX="6.75" PointY="12.75" /> - <EntityTypeShape EntityType="LocalModel.MACHINES_CONFIGURATIONS" Width="1.5" PointX="12.75" PointY="10.75" /> - <EntityTypeShape EntityType="LocalModel.MACHINES_EVENTS" Width="1.5" PointX="8.75" PointY="13.75" /> - <EntityTypeShape EntityType="LocalModel.MEDIA_COLORS" Width="1.5" PointX="10.75" PointY="13.75" /> - <EntityTypeShape EntityType="LocalModel.MEDIA_CONDITIONS" Width="1.5" PointX="12.75" PointY="13.75" /> - <EntityTypeShape EntityType="LocalModel.MEDIA_MATERIALS" Width="1.5" PointX="14.75" PointY="0.75" /> - <EntityTypeShape EntityType="LocalModel.MEDIA_PURPOSES" Width="1.5" PointX="0.75" PointY="14.75" /> - <EntityTypeShape EntityType="LocalModel.ORGANIZATION" Width="1.5" PointX="14.75" PointY="3.75" /> - <EntityTypeShape EntityType="LocalModel.PERMISSION" Width="1.5" PointX="14.75" PointY="7.75" /> - <EntityTypeShape EntityType="LocalModel.RML" Width="1.5" PointX="14.75" PointY="11.75" /> - <EntityTypeShape EntityType="LocalModel.ROLE" Width="1.5" PointX="2.75" PointY="15.75" /> - <EntityTypeShape EntityType="LocalModel.ROLES_PERMISSIONS" Width="1.5" PointX="16.75" PointY="0.75" /> - <EntityTypeShape EntityType="LocalModel.SYNC_CONFIGURATIONS" Width="1.5" PointX="16.75" PointY="3.75" /> - <EntityTypeShape EntityType="LocalModel.USER" Width="1.5" PointX="4.75" PointY="16.75" /> - <EntityTypeShape EntityType="LocalModel.USERS_ROLES" Width="1.5" PointX="16.75" PointY="6.75" /> + <EntityTypeShape EntityType="LocalModel.MACHINE" Width="1.5" PointX="12.75" PointY="6.75" /> + <EntityTypeShape EntityType="LocalModel.MACHINES_CONFIGURATIONS" Width="1.5" PointX="6.75" PointY="12.75" /> + <EntityTypeShape EntityType="LocalModel.MACHINES_EVENTS" Width="1.5" PointX="12.75" PointY="10.75" /> + <EntityTypeShape EntityType="LocalModel.MEDIA_COLORS" Width="1.5" PointX="8.75" PointY="13.75" /> + <EntityTypeShape EntityType="LocalModel.MEDIA_CONDITIONS" Width="1.5" PointX="14.75" PointY="0.75" /> + <EntityTypeShape EntityType="LocalModel.MEDIA_MATERIALS" Width="1.5" PointX="0.75" PointY="14.75" /> + <EntityTypeShape EntityType="LocalModel.MEDIA_PURPOSES" Width="1.5" PointX="14.75" PointY="3.75" /> + <EntityTypeShape EntityType="LocalModel.ORGANIZATION" Width="1.5" PointX="14.75" PointY="6.75" /> + <EntityTypeShape EntityType="LocalModel.PERMISSION" Width="1.5" PointX="14.75" PointY="10.75" /> + <EntityTypeShape EntityType="LocalModel.RML" Width="1.5" PointX="10.75" PointY="14.75" /> + <EntityTypeShape EntityType="LocalModel.ROLE" Width="1.5" PointX="12.75" PointY="14.75" /> + <EntityTypeShape EntityType="LocalModel.ROLES_PERMISSIONS" Width="1.5" PointX="14.75" PointY="14.75" /> + <EntityTypeShape EntityType="LocalModel.SYNC_CONFIGURATIONS" Width="1.5" PointX="2.75" PointY="15.75" /> + <EntityTypeShape EntityType="LocalModel.USER" Width="1.5" PointX="4.75" PointY="15.75" /> + <EntityTypeShape EntityType="LocalModel.USERS_ROLES" Width="1.5" PointX="16.75" PointY="0.75" /> </Diagram> </edmx:Diagrams> </edmx:Designer> diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/MACHINE_VERSIONS_CONFIGURATIONS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/MACHINE_VERSIONS_CONFIGURATIONS.cs deleted file mode 100644 index 79adafd58..000000000 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/MACHINE_VERSIONS_CONFIGURATIONS.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local.DB -{ - using System; - using System.Collections.Generic; - - public partial class MACHINE_VERSIONS_CONFIGURATIONS - { - public long ID { get; set; } - public string GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public double VERSION { get; set; } - public string MACHINE_VERSION_GUID { get; set; } - public string CONFIGURATION_GUID { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL.Local/Tango.DAL.Local.csproj b/Software/Visual_Studio/Tango.DAL.Local/Tango.DAL.Local.csproj index 2296ce942..db5f258a2 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/Tango.DAL.Local.csproj +++ b/Software/Visual_Studio/Tango.DAL.Local/Tango.DAL.Local.csproj @@ -161,9 +161,6 @@ <Compile Include="DB\MACHINE_VERSIONS.cs"> <DependentUpon>LocalADO.tt</DependentUpon> </Compile> - <Compile Include="DB\MACHINE_VERSIONS_CONFIGURATIONS.cs"> - <DependentUpon>LocalADO.tt</DependentUpon> - </Compile> <Compile Include="DB\MEDIA_COLORS.cs"> <DependentUpon>LocalADO.tt</DependentUpon> </Compile> diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationDisplayPanelVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationDisplayPanelVersion.cs index 4a06b47f1..4f1c6f071 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationDisplayPanelVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationDisplayPanelVersion.cs @@ -10,6 +10,44 @@ namespace Tango.DAL.Observables public class ApplicationDisplayPanelVersion : ObservableEntity<APPLICATION_DISPLAY_PANEL_VERSIONS> { + private Double _version; + /// <summary> + /// Gets or sets the applicationdisplaypanelversion version. + /// </summary> + [EntityFieldName("VERSION")] + public Double Version + { + get + { + return _version; + } + + set + { + _version = value; RaisePropertyChanged(nameof(Version)); + } + + } + + private String _name; + /// <summary> + /// Gets or sets the applicationdisplaypanelversion name. + /// </summary> + [EntityFieldName("NAME")] + public String Name + { + get + { + return _name; + } + + set + { + _name = value; RaisePropertyChanged(nameof(Name)); + } + + } + private ObservableCollection<Configuration> _configurations; /// <summary> /// Gets or sets the applicationdisplaypanelversion configurations. diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationFirmwareVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationFirmwareVersion.cs index 509b7afe6..5428e4974 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationFirmwareVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationFirmwareVersion.cs @@ -10,6 +10,44 @@ namespace Tango.DAL.Observables public class ApplicationFirmwareVersion : ObservableEntity<APPLICATION_FIRMWARE_VERSIONS> { + private Double _version; + /// <summary> + /// Gets or sets the applicationfirmwareversion version. + /// </summary> + [EntityFieldName("VERSION")] + public Double Version + { + get + { + return _version; + } + + set + { + _version = value; RaisePropertyChanged(nameof(Version)); + } + + } + + private String _name; + /// <summary> + /// Gets or sets the applicationfirmwareversion name. + /// </summary> + [EntityFieldName("NAME")] + public String Name + { + get + { + return _name; + } + + set + { + _name = value; RaisePropertyChanged(nameof(Name)); + } + + } + private ObservableCollection<Configuration> _configurations; /// <summary> /// Gets or sets the applicationfirmwareversion configurations. diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationOsVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationOsVersion.cs index 7d2c937e2..ee3522978 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationOsVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationOsVersion.cs @@ -10,6 +10,44 @@ namespace Tango.DAL.Observables public class ApplicationOsVersion : ObservableEntity<APPLICATION_OS_VERSIONS> { + private Double _version; + /// <summary> + /// Gets or sets the applicationosversion version. + /// </summary> + [EntityFieldName("VERSION")] + public Double Version + { + get + { + return _version; + } + + set + { + _version = value; RaisePropertyChanged(nameof(Version)); + } + + } + + private String _name; + /// <summary> + /// Gets or sets the applicationosversion name. + /// </summary> + [EntityFieldName("NAME")] + public String Name + { + get + { + return _name; + } + + set + { + _name = value; RaisePropertyChanged(nameof(Name)); + } + + } + private ObservableCollection<Configuration> _configurations; /// <summary> /// Gets or sets the applicationosversion configurations. diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationVersion.cs index 63400b251..7dd3648f6 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationVersion.cs @@ -10,6 +10,44 @@ namespace Tango.DAL.Observables public class ApplicationVersion : ObservableEntity<APPLICATION_VERSIONS> { + private Double _version; + /// <summary> + /// Gets or sets the applicationversion version. + /// </summary> + [EntityFieldName("VERSION")] + public Double Version + { + get + { + return _version; + } + + set + { + _version = value; RaisePropertyChanged(nameof(Version)); + } + + } + + private String _name; + /// <summary> + /// Gets or sets the applicationversion name. + /// </summary> + [EntityFieldName("NAME")] + public String Name + { + get + { + return _name; + } + + set + { + _name = value; RaisePropertyChanged(nameof(Name)); + } + + } + private ObservableCollection<Configuration> _configurations; /// <summary> /// Gets or sets the applicationversion configurations. diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cartridge.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cartridge.cs index f758d3893..3505ad6ba 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cartridge.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cartridge.cs @@ -10,6 +10,25 @@ namespace Tango.DAL.Observables public class Cartridge : ObservableEntity<CARTRIDGE> { + private String _serialnumber; + /// <summary> + /// Gets or sets the cartridge serial number. + /// </summary> + [EntityFieldName("SERIAL_NUMBER")] + public String SerialNumber + { + get + { + return _serialnumber; + } + + set + { + _serialnumber = value; RaisePropertyChanged(nameof(SerialNumber)); + } + + } + private String _cartridgetypeguid; /// <summary> /// Gets or sets the cartridge cartridge type guid. diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/CartridgeType.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/CartridgeType.cs index d84e02f9e..3c658a544 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/CartridgeType.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/CartridgeType.cs @@ -10,6 +10,44 @@ namespace Tango.DAL.Observables public class CartridgeType : ObservableEntity<CARTRIDGE_TYPES> { + private Int32 _code; + /// <summary> + /// Gets or sets the cartridgetype code. + /// </summary> + [EntityFieldName("CODE")] + public Int32 Code + { + get + { + return _code; + } + + set + { + _code = value; RaisePropertyChanged(nameof(Code)); + } + + } + + private String _name; + /// <summary> + /// Gets or sets the cartridgetype name. + /// </summary> + [EntityFieldName("NAME")] + public String Name + { + get + { + return _name; + } + + set + { + _name = value; RaisePropertyChanged(nameof(Name)); + } + + } + private ObservableCollection<Cartridge> _cartridges; /// <summary> /// Gets or sets the cartridgetype cartridges. diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Configuration.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Configuration.cs index 2c8c89233..1db20779d 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Configuration.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Configuration.cs @@ -257,25 +257,6 @@ namespace Tango.DAL.Observables } - private ObservableCollection<IdsPack> _idspacks; - /// <summary> - /// Gets or sets the configuration ids packs. - /// </summary> - [EntityFieldName("IDS_PACKS")] - public ObservableCollection<IdsPack> IdsPacks - { - get - { - return _idspacks; - } - - set - { - _idspacks = value; RaisePropertyChanged(nameof(IdsPacks)); - } - - } - private EmbeddedFirmwareVersion _embeddedfirmwareversions; /// <summary> /// Gets or sets the configuration embedded firmware versions. @@ -333,21 +314,40 @@ namespace Tango.DAL.Observables } - private ObservableCollection<MachineVersionsConfiguration> _machineversionsconfigurations; + private ObservableCollection<IdsPack> _idspacks; + /// <summary> + /// Gets or sets the configuration ids packs. + /// </summary> + [EntityFieldName("IDS_PACKS")] + public ObservableCollection<IdsPack> IdsPacks + { + get + { + return _idspacks; + } + + set + { + _idspacks = value; RaisePropertyChanged(nameof(IdsPacks)); + } + + } + + private ObservableCollection<MachineVersion> _machineversions; /// <summary> - /// Gets or sets the configuration machine versions configurations. + /// Gets or sets the configuration machine versions. /// </summary> - [EntityFieldName("MACHINE_VERSIONS_CONFIGURATIONS")] - public ObservableCollection<MachineVersionsConfiguration> MachineVersionsConfigurations + [EntityFieldName("MACHINE_VERSIONS")] + public ObservableCollection<MachineVersion> MachineVersions { get { - return _machineversionsconfigurations; + return _machineversions; } set { - _machineversionsconfigurations = value; RaisePropertyChanged(nameof(MachineVersionsConfigurations)); + _machineversions = value; RaisePropertyChanged(nameof(MachineVersions)); } } @@ -397,7 +397,7 @@ namespace Tango.DAL.Observables IdsPacks = new ObservableCollection<IdsPack>(); - MachineVersionsConfigurations = new ObservableCollection<MachineVersionsConfiguration>(); + MachineVersions = new ObservableCollection<MachineVersion>(); MachinesConfigurations = new ObservableCollection<MachinesConfiguration>(); diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Dispenser.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Dispenser.cs index 1a79e554d..7ec1520ba 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Dispenser.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Dispenser.cs @@ -10,6 +10,25 @@ namespace Tango.DAL.Observables public class Dispenser : ObservableEntity<DISPENSER> { + private String _serialnumber; + /// <summary> + /// Gets or sets the dispenser serial number. + /// </summary> + [EntityFieldName("SERIAL_NUMBER")] + public String SerialNumber + { + get + { + return _serialnumber; + } + + set + { + _serialnumber = value; RaisePropertyChanged(nameof(SerialNumber)); + } + + } + private String _dispensertypeguid; /// <summary> /// Gets or sets the dispenser dispenser type guid. diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/DispenserType.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/DispenserType.cs index 3c04564f0..13cd25159 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/DispenserType.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/DispenserType.cs @@ -10,6 +10,44 @@ namespace Tango.DAL.Observables public class DispenserType : ObservableEntity<DISPENSER_TYPES> { + private Int32 _code; + /// <summary> + /// Gets or sets the dispensertype code. + /// </summary> + [EntityFieldName("CODE")] + public Int32 Code + { + get + { + return _code; + } + + set + { + _code = value; RaisePropertyChanged(nameof(Code)); + } + + } + + private String _name; + /// <summary> + /// Gets or sets the dispensertype name. + /// </summary> + [EntityFieldName("NAME")] + public String Name + { + get + { + return _name; + } + + set + { + _name = value; RaisePropertyChanged(nameof(Name)); + } + + } + private ObservableCollection<Dispenser> _dispensers; /// <summary> /// Gets or sets the dispensertype dispensers. diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedFirmwareVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedFirmwareVersion.cs index 885955242..b9e4593aa 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedFirmwareVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedFirmwareVersion.cs @@ -10,6 +10,44 @@ namespace Tango.DAL.Observables public class EmbeddedFirmwareVersion : ObservableEntity<EMBEDDED_FIRMWARE_VERSIONS> { + private Double _version; + /// <summary> + /// Gets or sets the embeddedfirmwareversion version. + /// </summary> + [EntityFieldName("VERSION")] + public Double Version + { + get + { + return _version; + } + + set + { + _version = value; RaisePropertyChanged(nameof(Version)); + } + + } + + private String _name; + /// <summary> + /// Gets or sets the embeddedfirmwareversion name. + /// </summary> + [EntityFieldName("NAME")] + public String Name + { + get + { + return _name; + } + + set + { + _name = value; RaisePropertyChanged(nameof(Name)); + } + + } + private ObservableCollection<Configuration> _configurations; /// <summary> /// Gets or sets the embeddedfirmwareversion configurations. diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedSoftwareVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedSoftwareVersion.cs index 25d8255cf..ee66f11a1 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedSoftwareVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedSoftwareVersion.cs @@ -10,6 +10,44 @@ namespace Tango.DAL.Observables public class EmbeddedSoftwareVersion : ObservableEntity<EMBEDDED_SOFTWARE_VERSIONS> { + private Double _version; + /// <summary> + /// Gets or sets the embeddedsoftwareversion version. + /// </summary> + [EntityFieldName("VERSION")] + public Double Version + { + get + { + return _version; + } + + set + { + _version = value; RaisePropertyChanged(nameof(Version)); + } + + } + + private String _name; + /// <summary> + /// Gets or sets the embeddedsoftwareversion name. + /// </summary> + [EntityFieldName("NAME")] + public String Name + { + get + { + return _name; + } + + set + { + _name = value; RaisePropertyChanged(nameof(Name)); + } + + } + private ObservableCollection<Configuration> _configurations; /// <summary> /// Gets or sets the embeddedsoftwareversion configurations. diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/FiberSynthesis.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/FiberSynth.cs index 3e2acc54f..7a0caefc4 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/FiberSynthesis.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/FiberSynth.cs @@ -6,13 +6,13 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { - [EntityFieldName("FIBER_SYNTHESISES")] - public class FiberSynthesis : ObservableEntity<FIBER_SYNTHESISES> + [EntityFieldName("FIBER_SYNTHS")] + public class FiberSynth : ObservableEntity<FIBER_SYNTHS> { private String _name; /// <summary> - /// Gets or sets the fibersynthesis name. + /// Gets or sets the fibersynth name. /// </summary> [EntityFieldName("NAME")] public String Name @@ -31,7 +31,7 @@ namespace Tango.DAL.Observables private Int32 _code; /// <summary> - /// Gets or sets the fibersynthesis code. + /// Gets or sets the fibersynth code. /// </summary> [EntityFieldName("CODE")] public Int32 Code @@ -50,7 +50,7 @@ namespace Tango.DAL.Observables private ObservableCollection<Rml> _rmls; /// <summary> - /// Gets or sets the fibersynthesis rmls. + /// Gets or sets the fibersynth rmls. /// </summary> [EntityFieldName("RMLS")] public ObservableCollection<Rml> Rmls @@ -68,18 +68,18 @@ namespace Tango.DAL.Observables } /// <summary> - /// Initializes a new instance of the <see cref="FiberSynthesis" /> class. + /// Initializes a new instance of the <see cref="FiberSynth" /> class. /// </summary> - public FiberSynthesis() : base() + public FiberSynth() : base() { Init(); } /// <summary> - /// Initializes a new instance of the <see cref="FiberSynthesis" /> class. + /// Initializes a new instance of the <see cref="FiberSynth" /> class. /// </summary> /// <param name="entity">The entity.</param> - public FiberSynthesis(FIBER_SYNTHESISES entity) : base(entity) + public FiberSynth(FIBER_SYNTHS entity) : base(entity) { Init(); MapEntityToObservable(entity, this); diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/HardwareVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/HardwareVersion.cs index 054f9f20d..e0748bc48 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/HardwareVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/HardwareVersion.cs @@ -10,6 +10,44 @@ namespace Tango.DAL.Observables public class HardwareVersion : ObservableEntity<HARDWARE_VERSIONS> { + private Double _version; + /// <summary> + /// Gets or sets the hardwareversion version. + /// </summary> + [EntityFieldName("VERSION")] + public Double Version + { + get + { + return _version; + } + + set + { + _version = value; RaisePropertyChanged(nameof(Version)); + } + + } + + private String _name; + /// <summary> + /// Gets or sets the hardwareversion name. + /// </summary> + [EntityFieldName("NAME")] + public String Name + { + get + { + return _name; + } + + set + { + _name = value; RaisePropertyChanged(nameof(Name)); + } + + } + private ObservableCollection<Configuration> _configurations; /// <summary> /// Gets or sets the hardwareversion configurations. diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/IdsPack.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/IdsPack.cs index 303167b80..20de3c46d 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/IdsPack.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/IdsPack.cs @@ -86,6 +86,25 @@ namespace Tango.DAL.Observables } + private String _name; + /// <summary> + /// Gets or sets the idspack name. + /// </summary> + [EntityFieldName("NAME")] + public String Name + { + get + { + return _name; + } + + set + { + _name = value; RaisePropertyChanged(nameof(Name)); + } + + } + private Cartridge _cartridge; /// <summary> /// Gets or sets the idspack cartridge. diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Liquid.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Liquid.cs index 4c021757a..13e8eb15a 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Liquid.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Liquid.cs @@ -67,6 +67,25 @@ namespace Tango.DAL.Observables } + private Int32 _color; + /// <summary> + /// Gets or sets the liquid color. + /// </summary> + [EntityFieldName("COLOR")] + public Int32 Color + { + get + { + return _color; + } + + set + { + _color = value; RaisePropertyChanged(nameof(Color)); + } + + } + private ObservableCollection<IdsPack> _idspacks; /// <summary> /// Gets or sets the liquid ids packs. diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachineVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachineVersion.cs index 20ae58a1d..9205d8b9a 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachineVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachineVersion.cs @@ -29,21 +29,59 @@ namespace Tango.DAL.Observables } - private ObservableCollection<MachineVersionsConfiguration> _machineversionsconfigurations; + private String _name; /// <summary> - /// Gets or sets the machineversion machine versions configurations. + /// Gets or sets the machineversion name. /// </summary> - [EntityFieldName("MACHINE_VERSIONS_CONFIGURATIONS")] - public ObservableCollection<MachineVersionsConfiguration> MachineVersionsConfigurations + [EntityFieldName("NAME")] + public String Name { get { - return _machineversionsconfigurations; + return _name; } set { - _machineversionsconfigurations = value; RaisePropertyChanged(nameof(MachineVersionsConfigurations)); + _name = value; RaisePropertyChanged(nameof(Name)); + } + + } + + private String _defaultconfigurationguid; + /// <summary> + /// Gets or sets the machineversion default configuration guid. + /// </summary> + [EntityFieldName("DEFAULT_CONFIGURATION_GUID")] + public String DefaultConfigurationGuid + { + get + { + return _defaultconfigurationguid; + } + + set + { + _defaultconfigurationguid = value; RaisePropertyChanged(nameof(DefaultConfigurationGuid)); + } + + } + + private Configuration _configuration; + /// <summary> + /// Gets or sets the machineversion configuration. + /// </summary> + [EntityFieldName("CONFIGURATION")] + public Configuration Configuration + { + get + { + return _configuration; + } + + set + { + _configuration = value; RaisePropertyChanged(nameof(Configuration)); } } @@ -91,8 +129,6 @@ namespace Tango.DAL.Observables private void Init() { - MachineVersionsConfigurations = new ObservableCollection<MachineVersionsConfiguration>(); - Machines = new ObservableCollection<Machine>(); } diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachineVersionsConfiguration.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachineVersionsConfiguration.cs deleted file mode 100644 index 1206ebbd3..000000000 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachineVersionsConfiguration.cs +++ /dev/null @@ -1,114 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using Tango.DAL.Remote.DB; - -namespace Tango.DAL.Observables -{ - [EntityFieldName("MACHINE_VERSIONS_CONFIGURATIONS")] - public class MachineVersionsConfiguration : ObservableEntity<MACHINE_VERSIONS_CONFIGURATIONS> - { - - private String _machineversionguid; - /// <summary> - /// Gets or sets the machineversionsconfiguration machine version guid. - /// </summary> - [EntityFieldName("MACHINE_VERSION_GUID")] - public String MachineVersionGuid - { - get - { - return _machineversionguid; - } - - set - { - _machineversionguid = value; RaisePropertyChanged(nameof(MachineVersionGuid)); - } - - } - - private String _configurationguid; - /// <summary> - /// Gets or sets the machineversionsconfiguration configuration guid. - /// </summary> - [EntityFieldName("CONFIGURATION_GUID")] - public String ConfigurationGuid - { - get - { - return _configurationguid; - } - - set - { - _configurationguid = value; RaisePropertyChanged(nameof(ConfigurationGuid)); - } - - } - - private Configuration _configuration; - /// <summary> - /// Gets or sets the machineversionsconfiguration configuration. - /// </summary> - [EntityFieldName("CONFIGURATION")] - public Configuration Configuration - { - get - { - return _configuration; - } - - set - { - _configuration = value; RaisePropertyChanged(nameof(Configuration)); - } - - } - - private MachineVersion _machineversions; - /// <summary> - /// Gets or sets the machineversionsconfiguration machine versions. - /// </summary> - [EntityFieldName("MACHINE_VERSIONS")] - public MachineVersion MachineVersions - { - get - { - return _machineversions; - } - - set - { - _machineversions = value; RaisePropertyChanged(nameof(MachineVersions)); - } - - } - - /// <summary> - /// Initializes a new instance of the <see cref="MachineVersionsConfiguration" /> class. - /// </summary> - public MachineVersionsConfiguration() : base() - { - Init(); - } - - /// <summary> - /// Initializes a new instance of the <see cref="MachineVersionsConfiguration" /> class. - /// </summary> - /// <param name="entity">The entity.</param> - public MachineVersionsConfiguration(MACHINE_VERSIONS_CONFIGURATIONS entity) : base(entity) - { - Init(); - MapEntityToObservable(entity, this); - } - - /// <summary> - /// Initialize complex types. - /// </summary> - private void Init() - { - } - } -} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Rml.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Rml.cs index f0a78e074..1a2d31fe1 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Rml.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Rml.cs @@ -143,21 +143,21 @@ namespace Tango.DAL.Observables } - private String _fibersynthesisguid; + private String _fibersynthguid; /// <summary> - /// Gets or sets the rml fiber synthesis guid. + /// Gets or sets the rml fiber synth guid. /// </summary> - [EntityFieldName("FIBER_SYNTHESIS_GUID")] - public String FiberSynthesisGuid + [EntityFieldName("FIBER_SYNTH_GUID")] + public String FiberSynthGuid { get { - return _fibersynthesisguid; + return _fibersynthguid; } set { - _fibersynthesisguid = value; RaisePropertyChanged(nameof(FiberSynthesisGuid)); + _fibersynthguid = value; RaisePropertyChanged(nameof(FiberSynthGuid)); } } @@ -371,21 +371,21 @@ namespace Tango.DAL.Observables } - private FiberSynthesis _fibersynthesises; + private FiberSynth _fibersynths; /// <summary> - /// Gets or sets the rml fiber synthesises. + /// Gets or sets the rml fiber synths. /// </summary> - [EntityFieldName("FIBER_SYNTHESISES")] - public FiberSynthesis FiberSynthesises + [EntityFieldName("FIBER_SYNTHS")] + public FiberSynth FiberSynths { get { - return _fibersynthesises; + return _fibersynths; } set { - _fibersynthesises = value; RaisePropertyChanged(nameof(FiberSynthesises)); + _fibersynths = value; RaisePropertyChanged(nameof(FiberSynths)); } } diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/Actions.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/Actions.cs new file mode 100644 index 000000000..5723920b5 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/Actions.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.ComponentModel; + +namespace Tango.DAL.Observables +{ + public enum Actions + { + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/CartridgeTypes.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/CartridgeTypes.cs new file mode 100644 index 000000000..35cc310c6 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/CartridgeTypes.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.ComponentModel; + +namespace Tango.DAL.Observables +{ + public enum CartridgeTypes + { + + /// <summary> + /// (Cartridge 1) + /// </summary> + [Description("Cartridge 1")] + Cartridge1 = 1, + + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/DispenserTypes.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/DispenserTypes.cs new file mode 100644 index 000000000..bcd085dc4 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/DispenserTypes.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.ComponentModel; + +namespace Tango.DAL.Observables +{ + public enum DispenserTypes + { + + /// <summary> + /// (Dispenser 1) + /// </summary> + [Description("Dispenser 1")] + Dispenser1 = 1, + + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/Events.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/Events.cs new file mode 100644 index 000000000..63becf698 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/Events.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.ComponentModel; + +namespace Tango.DAL.Observables +{ + public enum Events + { + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/FiberShapes.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/FiberShapes.cs new file mode 100644 index 000000000..53a56c61f --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/FiberShapes.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.ComponentModel; + +namespace Tango.DAL.Observables +{ + public enum FiberShapes + { + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/FiberSynthes.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/FiberSynthes.cs new file mode 100644 index 000000000..4bc13b83a --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/FiberSynthes.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.ComponentModel; + +namespace Tango.DAL.Observables +{ + public enum FiberSynthes + { + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/FiberSynthesises.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/FiberSynthesises.cs new file mode 100644 index 000000000..e66e5f3df --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/FiberSynthesises.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.ComponentModel; + +namespace Tango.DAL.Observables +{ + public enum FiberSynthesises + { + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/FiberSynths.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/FiberSynths.cs new file mode 100644 index 000000000..aa2dfec11 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/FiberSynths.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.ComponentModel; + +namespace Tango.DAL.Observables +{ + public enum FiberSynths + { + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/LinearMassDensityUnits.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/LinearMassDensityUnits.cs new file mode 100644 index 000000000..e5fc1e320 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/LinearMassDensityUnits.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.ComponentModel; + +namespace Tango.DAL.Observables +{ + public enum LinearMassDensityUnits + { + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/Liquids.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/Liquids.cs new file mode 100644 index 000000000..95cf098b1 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/Liquids.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.ComponentModel; + +namespace Tango.DAL.Observables +{ + public enum Liquids + { + + /// <summary> + /// (Cyan) + /// </summary> + [Description("Cyan")] + Cyan = 1, + + /// <summary> + /// (Magenta) + /// </summary> + [Description("Magenta")] + Magenta = 2, + + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/MediaConditions.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/MediaConditions.cs new file mode 100644 index 000000000..8f7016c5d --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/MediaConditions.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.ComponentModel; + +namespace Tango.DAL.Observables +{ + public enum MediaConditions + { + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/MediaMaterials.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/MediaMaterials.cs new file mode 100644 index 000000000..252b2772a --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/MediaMaterials.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.ComponentModel; + +namespace Tango.DAL.Observables +{ + public enum MediaMaterials + { + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/MediaPurposes.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/MediaPurposes.cs new file mode 100644 index 000000000..c47a96064 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/MediaPurposes.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.ComponentModel; + +namespace Tango.DAL.Observables +{ + public enum MediaPurposes + { + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/PermissionsEnum.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/Permissions.cs index 7390d4ac9..542555b51 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/PermissionsEnum.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/Permissions.cs @@ -6,7 +6,7 @@ using System.ComponentModel; namespace Tango.DAL.Observables { - public enum PermissionsEnum + public enum Permissions { /// <summary> diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/RolesEnum.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/Roles.cs index f2a144a57..6563e0826 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/RolesEnum.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/Roles.cs @@ -6,7 +6,7 @@ using System.ComponentModel; namespace Tango.DAL.Observables { - public enum RolesEnum + public enum Roles { /// <summary> diff --git a/Software/Visual_Studio/Tango.DAL.Observables/IObservableEntity.cs b/Software/Visual_Studio/Tango.DAL.Observables/IObservableEntity.cs index 9bef6e6f0..397d7b820 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/IObservableEntity.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/IObservableEntity.cs @@ -23,6 +23,10 @@ namespace Tango.DAL.Observables void Save(); + Task SaveAsync(); + void Delete(); + + List<KeyValuePair<String, String>> GetDependentEntitiesNameAndGuid(); } } diff --git a/Software/Visual_Studio/Tango.DAL.Observables/ObservableEntity.cs b/Software/Visual_Studio/Tango.DAL.Observables/ObservableEntity.cs index b021d092a..e5e49ac38 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/ObservableEntity.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/ObservableEntity.cs @@ -119,7 +119,25 @@ namespace Tango.DAL.Observables } } + public List<KeyValuePair<String, String>> GetDependentEntitiesNameAndGuid() + { + List<KeyValuePair<String, String>> namesAndIds = new List<KeyValuePair<string, string>>(); + + foreach (var prop in this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsGenericType)) + { + IList list = prop.GetValue(this) as IList; + + foreach (var item in list) + { + namesAndIds.Add(new KeyValuePair<string, string>(item.GetType().Name, item.GetType().GetProperty("ID").GetValue(item).ToString())); + } + } + + return namesAndIds; + } + public abstract void Delete(); + public abstract Task SaveAsync(); } public abstract class ObservableEntity<T> : ObservableEntity where T : class @@ -185,6 +203,14 @@ namespace Tango.DAL.Observables ObservablesEntitiesAdapter.Instance.SaveChanges(); } + public override Task SaveAsync() + { + return Task.Factory.StartNew(() => + { + Save(); + }); + } + public override void Delete() { String tabelName = this.GetType().GetDALName(); @@ -202,17 +228,23 @@ namespace Tango.DAL.Observables foreach (var prop in this.GetType().GetProperties().Where(x => !x.PropertyType.IsGenericType && x.PropertyType.IsClass && x.PropertyType != typeof(String) && x.PropertyType != typeof(DateTime))) { IObservableEntity propObservable = prop.GetValue(this) as IObservableEntity; - try - { - this.GetType().GetProperty(prop.Name + "Guid").SetValue(this, propObservable.Guid); - } - catch (NullReferenceException) - { - this.GetType().GetProperty(prop.Name.Singularize() + "Guid").SetValue(this, propObservable.Guid); - } - catch + + if (propObservable != null) { - throw; + var guidProp = this.GetType().GetProperty(prop.Name + "Guid"); + + if (guidProp != null) + { + guidProp.SetValue(this, propObservable.Guid); + } + else + { + guidProp = this.GetType().GetProperty(prop.Name.SingularizeMVC() + "Guid"); + if (guidProp != null) + { + guidProp.SetValue(this, propObservable.Guid); + } + } } } diff --git a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs index 09a380de1..0be7419e1 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs @@ -13,7 +13,7 @@ using Tango.Settings; namespace Tango.DAL.Observables { - public class ObservablesEntitiesAdapter : ExtendedObject + public partial class ObservablesEntitiesAdapter : ExtendedObject { private static ObservablesEntitiesAdapter _instance; @@ -39,6 +39,10 @@ namespace Tango.DAL.Observables private ObservablesEntitiesAdapter() { Context = new RemoteDB(SettingsManager.Default.DataBase.SQLServerAddress, false); + } + + public void Initialize() + { Invalidate(); } @@ -82,72 +86,41 @@ namespace Tango.DAL.Observables { role.RolesPermissions = role.RolesPermissions.Where(x => !x.Deleted).ToObservableCollection(); } - } - private ObservableCollection<Organization> _organizations; - public ObservableCollection<Organization> Organizations - { - get { return _organizations; } - set { _organizations = value; RaisePropertyChangedAuto(); } - } + Configurations = Context.CONFIGURATIONS.Where(x => !x.DELETED).ToList().OrderBy(x => x.LAST_UPDATED).Select(x => ObservableEntity.CreateObservableFromEntity<Configuration>(x)).ToObservableCollection(); - private ICollectionView _organizationsViewSource; - public ICollectionView OrganizationsViewSource - { - get { return _organizationsViewSource; } - set { _organizationsViewSource = value; RaisePropertyChangedAuto(); } - } - - private ObservableCollection<Machine> _machines; - public ObservableCollection<Machine> Machines - { - get { return _machines; } - set + foreach (var config in Configurations) { - _machines = value; RaisePropertyChangedAuto(); + config.IdsPacks = config.IdsPacks.Where(x => !x.Deleted).ToObservableCollection(); } - } - private ObservableCollection<MachineVersion> _machineVersions; - public ObservableCollection<MachineVersion> MachineVersions - { - get { return _machineVersions; } - set { _machineVersions = value; RaisePropertyChangedAuto(); } - } + ApplicationVersions = Context.APPLICATION_VERSIONS.Where(x => !x.DELETED).ToList().OrderBy(x => x.VERSION).Select(x => ObservableEntity.CreateObservableFromEntity<ApplicationVersion>(x)).ToObservableCollection(); - private ObservableCollection<Address> _addresses; - public ObservableCollection<Address> Addresses - { - get { return _addresses; } - set { _addresses = value; RaisePropertyChangedAuto(); } - } + ApplicationOsVersions = Context.APPLICATION_OS_VERSIONS.Where(x => !x.DELETED).ToList().OrderBy(x => x.VERSION).Select(x => ObservableEntity.CreateObservableFromEntity<ApplicationOsVersion>(x)).ToObservableCollection(); - private ObservableCollection<Contact> _contacts; - public ObservableCollection<Contact> Contacts - { - get { return _contacts; } - set { _contacts = value; RaisePropertyChangedAuto(); } - } + ApplicationFirmwareVersions = Context.APPLICATION_FIRMWARE_VERSIONS.Where(x => !x.DELETED).ToList().OrderBy(x => x.VERSION).Select(x => ObservableEntity.CreateObservableFromEntity<ApplicationFirmwareVersion>(x)).ToObservableCollection(); - private ObservableCollection<User> _users; - public ObservableCollection<User> Users - { - get { return _users; } - set { _users = value; RaisePropertyChangedAuto(); } - } + ApplicationDisplayPanelVersions = Context.APPLICATION_DISPLAY_PANEL_VERSIONS.Where(x => !x.DELETED).ToList().OrderBy(x => x.VERSION).Select(x => ObservableEntity.CreateObservableFromEntity<ApplicationDisplayPanelVersion>(x)).ToObservableCollection(); - private ObservableCollection<Role> _roles; - public ObservableCollection<Role> Roles - { - get { return _roles; } - set { _roles = value; RaisePropertyChangedAuto(); } - } + EmbeddedFirmwareVersions = Context.EMBEDDED_FIRMWARE_VERSIONS.Where(x => !x.DELETED).ToList().OrderBy(x => x.VERSION).Select(x => ObservableEntity.CreateObservableFromEntity<EmbeddedFirmwareVersion>(x)).ToObservableCollection(); - private ObservableCollection<Permission> _permissions; - public ObservableCollection<Permission> Permissions - { - get { return _permissions; } - set { _permissions = value; RaisePropertyChangedAuto(); } + EmbeddedSoftwareVersions = Context.EMBEDDED_SOFTWARE_VERSIONS.Where(x => !x.DELETED).ToList().OrderBy(x => x.VERSION).Select(x => ObservableEntity.CreateObservableFromEntity<EmbeddedSoftwareVersion>(x)).ToObservableCollection(); + + HardwareVersions = Context.HARDWARE_VERSIONS.Where(x => !x.DELETED).ToList().OrderBy(x => x.VERSION).Select(x => ObservableEntity.CreateObservableFromEntity<HardwareVersion>(x)).ToObservableCollection(); + + IdsPacks = Context.IDS_PACKS.Where(x => !x.DELETED).ToList().OrderBy(x => x.CONFIGURATION_GUID).Select(x => ObservableEntity.CreateObservableFromEntity<IdsPack>(x)).ToObservableCollection(); + + Dispensers = Context.DISPENSERS.Where(x => !x.DELETED).ToList().Select(x => ObservableEntity.CreateObservableFromEntity<Dispenser>(x)).ToObservableCollection(); + + DispenserTypes = Context.DISPENSER_TYPES.Where(x => !x.DELETED).ToList().Select(x => ObservableEntity.CreateObservableFromEntity<DispenserType>(x)).ToObservableCollection(); + + Liquids = Context.LIQUIDS.Where(x => !x.DELETED).ToList().Select(x => ObservableEntity.CreateObservableFromEntity<Liquid>(x)).ToObservableCollection(); + + Cartridges = Context.CARTRIDGES.Where(x => !x.DELETED).ToList().Select(x => ObservableEntity.CreateObservableFromEntity<Cartridge>(x)).ToObservableCollection(); + + CartridgeTypes = Context.CARTRIDGE_TYPES.Where(x => !x.DELETED).ToList().Select(x => ObservableEntity.CreateObservableFromEntity<CartridgeType>(x)).ToObservableCollection(); + + InitCollectionSources(); } private ICollectionView CreateCollectionView<T>(ObservableCollection<T> collection) diff --git a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapterExtension.cs b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapterExtension.cs new file mode 100644 index 000000000..9fdab5b8b --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapterExtension.cs @@ -0,0 +1,1499 @@ +using System.Collections.ObjectModel; +using System.ComponentModel; + +namespace Tango.DAL.Observables +{ + public partial class ObservablesEntitiesAdapter + { + + private ObservableCollection<Action> _actions; + /// <summary> + /// Gets or sets the Actions. + /// </summary> + public ObservableCollection<Action> Actions + { + get + { + return _actions; + } + + set + { + _actions = value; RaisePropertyChanged(nameof(Actions)); + } + + } + + private ICollectionView _actionsViewSource; + /// <summary> + /// Gets or sets the Actions View Source. + ///</summary> + public ICollectionView ActionsViewSource + { + get + { + return _actionsViewSource; + } + + set + { + _actionsViewSource = value; RaisePropertyChanged(nameof(ActionsViewSource)); + } + + } + + private ObservableCollection<Address> _addresses; + /// <summary> + /// Gets or sets the Addresses. + /// </summary> + public ObservableCollection<Address> Addresses + { + get + { + return _addresses; + } + + set + { + _addresses = value; RaisePropertyChanged(nameof(Addresses)); + } + + } + + private ICollectionView _addressesViewSource; + /// <summary> + /// Gets or sets the Addresses View Source. + ///</summary> + public ICollectionView AddressesViewSource + { + get + { + return _addressesViewSource; + } + + set + { + _addressesViewSource = value; RaisePropertyChanged(nameof(AddressesViewSource)); + } + + } + + private ObservableCollection<ApplicationDisplayPanelVersion> _applicationdisplaypanelversions; + /// <summary> + /// Gets or sets the ApplicationDisplayPanelVersions. + /// </summary> + public ObservableCollection<ApplicationDisplayPanelVersion> ApplicationDisplayPanelVersions + { + get + { + return _applicationdisplaypanelversions; + } + + set + { + _applicationdisplaypanelversions = value; RaisePropertyChanged(nameof(ApplicationDisplayPanelVersions)); + } + + } + + private ICollectionView _applicationdisplaypanelversionsViewSource; + /// <summary> + /// Gets or sets the ApplicationDisplayPanelVersions View Source. + ///</summary> + public ICollectionView ApplicationDisplayPanelVersionsViewSource + { + get + { + return _applicationdisplaypanelversionsViewSource; + } + + set + { + _applicationdisplaypanelversionsViewSource = value; RaisePropertyChanged(nameof(ApplicationDisplayPanelVersionsViewSource)); + } + + } + + private ObservableCollection<ApplicationFirmwareVersion> _applicationfirmwareversions; + /// <summary> + /// Gets or sets the ApplicationFirmwareVersions. + /// </summary> + public ObservableCollection<ApplicationFirmwareVersion> ApplicationFirmwareVersions + { + get + { + return _applicationfirmwareversions; + } + + set + { + _applicationfirmwareversions = value; RaisePropertyChanged(nameof(ApplicationFirmwareVersions)); + } + + } + + private ICollectionView _applicationfirmwareversionsViewSource; + /// <summary> + /// Gets or sets the ApplicationFirmwareVersions View Source. + ///</summary> + public ICollectionView ApplicationFirmwareVersionsViewSource + { + get + { + return _applicationfirmwareversionsViewSource; + } + + set + { + _applicationfirmwareversionsViewSource = value; RaisePropertyChanged(nameof(ApplicationFirmwareVersionsViewSource)); + } + + } + + private ObservableCollection<ApplicationOsVersion> _applicationosversions; + /// <summary> + /// Gets or sets the ApplicationOsVersions. + /// </summary> + public ObservableCollection<ApplicationOsVersion> ApplicationOsVersions + { + get + { + return _applicationosversions; + } + + set + { + _applicationosversions = value; RaisePropertyChanged(nameof(ApplicationOsVersions)); + } + + } + + private ICollectionView _applicationosversionsViewSource; + /// <summary> + /// Gets or sets the ApplicationOsVersions View Source. + ///</summary> + public ICollectionView ApplicationOsVersionsViewSource + { + get + { + return _applicationosversionsViewSource; + } + + set + { + _applicationosversionsViewSource = value; RaisePropertyChanged(nameof(ApplicationOsVersionsViewSource)); + } + + } + + private ObservableCollection<ApplicationVersion> _applicationversions; + /// <summary> + /// Gets or sets the ApplicationVersions. + /// </summary> + public ObservableCollection<ApplicationVersion> ApplicationVersions + { + get + { + return _applicationversions; + } + + set + { + _applicationversions = value; RaisePropertyChanged(nameof(ApplicationVersions)); + } + + } + + private ICollectionView _applicationversionsViewSource; + /// <summary> + /// Gets or sets the ApplicationVersions View Source. + ///</summary> + public ICollectionView ApplicationVersionsViewSource + { + get + { + return _applicationversionsViewSource; + } + + set + { + _applicationversionsViewSource = value; RaisePropertyChanged(nameof(ApplicationVersionsViewSource)); + } + + } + + private ObservableCollection<CartridgeType> _cartridgetypes; + /// <summary> + /// Gets or sets the CartridgeTypes. + /// </summary> + public ObservableCollection<CartridgeType> CartridgeTypes + { + get + { + return _cartridgetypes; + } + + set + { + _cartridgetypes = value; RaisePropertyChanged(nameof(CartridgeTypes)); + } + + } + + private ICollectionView _cartridgetypesViewSource; + /// <summary> + /// Gets or sets the CartridgeTypes View Source. + ///</summary> + public ICollectionView CartridgeTypesViewSource + { + get + { + return _cartridgetypesViewSource; + } + + set + { + _cartridgetypesViewSource = value; RaisePropertyChanged(nameof(CartridgeTypesViewSource)); + } + + } + + private ObservableCollection<Cartridge> _cartridges; + /// <summary> + /// Gets or sets the Cartridges. + /// </summary> + public ObservableCollection<Cartridge> Cartridges + { + get + { + return _cartridges; + } + + set + { + _cartridges = value; RaisePropertyChanged(nameof(Cartridges)); + } + + } + + private ICollectionView _cartridgesViewSource; + /// <summary> + /// Gets or sets the Cartridges View Source. + ///</summary> + public ICollectionView CartridgesViewSource + { + get + { + return _cartridgesViewSource; + } + + set + { + _cartridgesViewSource = value; RaisePropertyChanged(nameof(CartridgesViewSource)); + } + + } + + private ObservableCollection<Configuration> _configurations; + /// <summary> + /// Gets or sets the Configurations. + /// </summary> + public ObservableCollection<Configuration> Configurations + { + get + { + return _configurations; + } + + set + { + _configurations = value; RaisePropertyChanged(nameof(Configurations)); + } + + } + + private ICollectionView _configurationsViewSource; + /// <summary> + /// Gets or sets the Configurations View Source. + ///</summary> + public ICollectionView ConfigurationsViewSource + { + get + { + return _configurationsViewSource; + } + + set + { + _configurationsViewSource = value; RaisePropertyChanged(nameof(ConfigurationsViewSource)); + } + + } + + private ObservableCollection<Contact> _contacts; + /// <summary> + /// Gets or sets the Contacts. + /// </summary> + public ObservableCollection<Contact> Contacts + { + get + { + return _contacts; + } + + set + { + _contacts = value; RaisePropertyChanged(nameof(Contacts)); + } + + } + + private ICollectionView _contactsViewSource; + /// <summary> + /// Gets or sets the Contacts View Source. + ///</summary> + public ICollectionView ContactsViewSource + { + get + { + return _contactsViewSource; + } + + set + { + _contactsViewSource = value; RaisePropertyChanged(nameof(ContactsViewSource)); + } + + } + + private ObservableCollection<DispenserType> _dispensertypes; + /// <summary> + /// Gets or sets the DispenserTypes. + /// </summary> + public ObservableCollection<DispenserType> DispenserTypes + { + get + { + return _dispensertypes; + } + + set + { + _dispensertypes = value; RaisePropertyChanged(nameof(DispenserTypes)); + } + + } + + private ICollectionView _dispensertypesViewSource; + /// <summary> + /// Gets or sets the DispenserTypes View Source. + ///</summary> + public ICollectionView DispenserTypesViewSource + { + get + { + return _dispensertypesViewSource; + } + + set + { + _dispensertypesViewSource = value; RaisePropertyChanged(nameof(DispenserTypesViewSource)); + } + + } + + private ObservableCollection<Dispenser> _dispensers; + /// <summary> + /// Gets or sets the Dispensers. + /// </summary> + public ObservableCollection<Dispenser> Dispensers + { + get + { + return _dispensers; + } + + set + { + _dispensers = value; RaisePropertyChanged(nameof(Dispensers)); + } + + } + + private ICollectionView _dispensersViewSource; + /// <summary> + /// Gets or sets the Dispensers View Source. + ///</summary> + public ICollectionView DispensersViewSource + { + get + { + return _dispensersViewSource; + } + + set + { + _dispensersViewSource = value; RaisePropertyChanged(nameof(DispensersViewSource)); + } + + } + + private ObservableCollection<EmbeddedFirmwareVersion> _embeddedfirmwareversions; + /// <summary> + /// Gets or sets the EmbeddedFirmwareVersions. + /// </summary> + public ObservableCollection<EmbeddedFirmwareVersion> EmbeddedFirmwareVersions + { + get + { + return _embeddedfirmwareversions; + } + + set + { + _embeddedfirmwareversions = value; RaisePropertyChanged(nameof(EmbeddedFirmwareVersions)); + } + + } + + private ICollectionView _embeddedfirmwareversionsViewSource; + /// <summary> + /// Gets or sets the EmbeddedFirmwareVersions View Source. + ///</summary> + public ICollectionView EmbeddedFirmwareVersionsViewSource + { + get + { + return _embeddedfirmwareversionsViewSource; + } + + set + { + _embeddedfirmwareversionsViewSource = value; RaisePropertyChanged(nameof(EmbeddedFirmwareVersionsViewSource)); + } + + } + + private ObservableCollection<EmbeddedSoftwareVersion> _embeddedsoftwareversions; + /// <summary> + /// Gets or sets the EmbeddedSoftwareVersions. + /// </summary> + public ObservableCollection<EmbeddedSoftwareVersion> EmbeddedSoftwareVersions + { + get + { + return _embeddedsoftwareversions; + } + + set + { + _embeddedsoftwareversions = value; RaisePropertyChanged(nameof(EmbeddedSoftwareVersions)); + } + + } + + private ICollectionView _embeddedsoftwareversionsViewSource; + /// <summary> + /// Gets or sets the EmbeddedSoftwareVersions View Source. + ///</summary> + public ICollectionView EmbeddedSoftwareVersionsViewSource + { + get + { + return _embeddedsoftwareversionsViewSource; + } + + set + { + _embeddedsoftwareversionsViewSource = value; RaisePropertyChanged(nameof(EmbeddedSoftwareVersionsViewSource)); + } + + } + + private ObservableCollection<Event> _events; + /// <summary> + /// Gets or sets the Events. + /// </summary> + public ObservableCollection<Event> Events + { + get + { + return _events; + } + + set + { + _events = value; RaisePropertyChanged(nameof(Events)); + } + + } + + private ICollectionView _eventsViewSource; + /// <summary> + /// Gets or sets the Events View Source. + ///</summary> + public ICollectionView EventsViewSource + { + get + { + return _eventsViewSource; + } + + set + { + _eventsViewSource = value; RaisePropertyChanged(nameof(EventsViewSource)); + } + + } + + private ObservableCollection<EventsAction> _eventsactions; + /// <summary> + /// Gets or sets the EventsActions. + /// </summary> + public ObservableCollection<EventsAction> EventsActions + { + get + { + return _eventsactions; + } + + set + { + _eventsactions = value; RaisePropertyChanged(nameof(EventsActions)); + } + + } + + private ICollectionView _eventsactionsViewSource; + /// <summary> + /// Gets or sets the EventsActions View Source. + ///</summary> + public ICollectionView EventsActionsViewSource + { + get + { + return _eventsactionsViewSource; + } + + set + { + _eventsactionsViewSource = value; RaisePropertyChanged(nameof(EventsActionsViewSource)); + } + + } + + private ObservableCollection<FiberShape> _fibershapes; + /// <summary> + /// Gets or sets the FiberShapes. + /// </summary> + public ObservableCollection<FiberShape> FiberShapes + { + get + { + return _fibershapes; + } + + set + { + _fibershapes = value; RaisePropertyChanged(nameof(FiberShapes)); + } + + } + + private ICollectionView _fibershapesViewSource; + /// <summary> + /// Gets or sets the FiberShapes View Source. + ///</summary> + public ICollectionView FiberShapesViewSource + { + get + { + return _fibershapesViewSource; + } + + set + { + _fibershapesViewSource = value; RaisePropertyChanged(nameof(FiberShapesViewSource)); + } + + } + + private ObservableCollection<FiberSynth> _fibersynths; + /// <summary> + /// Gets or sets the FiberSynths. + /// </summary> + public ObservableCollection<FiberSynth> FiberSynths + { + get + { + return _fibersynths; + } + + set + { + _fibersynths = value; RaisePropertyChanged(nameof(FiberSynths)); + } + + } + + private ICollectionView _fibersynthsViewSource; + /// <summary> + /// Gets or sets the FiberSynths View Source. + ///</summary> + public ICollectionView FiberSynthsViewSource + { + get + { + return _fibersynthsViewSource; + } + + set + { + _fibersynthsViewSource = value; RaisePropertyChanged(nameof(FiberSynthsViewSource)); + } + + } + + private ObservableCollection<HardwareVersion> _hardwareversions; + /// <summary> + /// Gets or sets the HardwareVersions. + /// </summary> + public ObservableCollection<HardwareVersion> HardwareVersions + { + get + { + return _hardwareversions; + } + + set + { + _hardwareversions = value; RaisePropertyChanged(nameof(HardwareVersions)); + } + + } + + private ICollectionView _hardwareversionsViewSource; + /// <summary> + /// Gets or sets the HardwareVersions View Source. + ///</summary> + public ICollectionView HardwareVersionsViewSource + { + get + { + return _hardwareversionsViewSource; + } + + set + { + _hardwareversionsViewSource = value; RaisePropertyChanged(nameof(HardwareVersionsViewSource)); + } + + } + + private ObservableCollection<IdsPack> _idspacks; + /// <summary> + /// Gets or sets the IdsPacks. + /// </summary> + public ObservableCollection<IdsPack> IdsPacks + { + get + { + return _idspacks; + } + + set + { + _idspacks = value; RaisePropertyChanged(nameof(IdsPacks)); + } + + } + + private ICollectionView _idspacksViewSource; + /// <summary> + /// Gets or sets the IdsPacks View Source. + ///</summary> + public ICollectionView IdsPacksViewSource + { + get + { + return _idspacksViewSource; + } + + set + { + _idspacksViewSource = value; RaisePropertyChanged(nameof(IdsPacksViewSource)); + } + + } + + private ObservableCollection<LinearMassDensityUnit> _linearmassdensityunits; + /// <summary> + /// Gets or sets the LinearMassDensityUnits. + /// </summary> + public ObservableCollection<LinearMassDensityUnit> LinearMassDensityUnits + { + get + { + return _linearmassdensityunits; + } + + set + { + _linearmassdensityunits = value; RaisePropertyChanged(nameof(LinearMassDensityUnits)); + } + + } + + private ICollectionView _linearmassdensityunitsViewSource; + /// <summary> + /// Gets or sets the LinearMassDensityUnits View Source. + ///</summary> + public ICollectionView LinearMassDensityUnitsViewSource + { + get + { + return _linearmassdensityunitsViewSource; + } + + set + { + _linearmassdensityunitsViewSource = value; RaisePropertyChanged(nameof(LinearMassDensityUnitsViewSource)); + } + + } + + private ObservableCollection<Liquid> _liquids; + /// <summary> + /// Gets or sets the Liquids. + /// </summary> + public ObservableCollection<Liquid> Liquids + { + get + { + return _liquids; + } + + set + { + _liquids = value; RaisePropertyChanged(nameof(Liquids)); + } + + } + + private ICollectionView _liquidsViewSource; + /// <summary> + /// Gets or sets the Liquids View Source. + ///</summary> + public ICollectionView LiquidsViewSource + { + get + { + return _liquidsViewSource; + } + + set + { + _liquidsViewSource = value; RaisePropertyChanged(nameof(LiquidsViewSource)); + } + + } + + private ObservableCollection<LiquidsRml> _liquidsrmls; + /// <summary> + /// Gets or sets the LiquidsRmls. + /// </summary> + public ObservableCollection<LiquidsRml> LiquidsRmls + { + get + { + return _liquidsrmls; + } + + set + { + _liquidsrmls = value; RaisePropertyChanged(nameof(LiquidsRmls)); + } + + } + + private ICollectionView _liquidsrmlsViewSource; + /// <summary> + /// Gets or sets the LiquidsRmls View Source. + ///</summary> + public ICollectionView LiquidsRmlsViewSource + { + get + { + return _liquidsrmlsViewSource; + } + + set + { + _liquidsrmlsViewSource = value; RaisePropertyChanged(nameof(LiquidsRmlsViewSource)); + } + + } + + private ObservableCollection<MachineVersion> _machineversions; + /// <summary> + /// Gets or sets the MachineVersions. + /// </summary> + public ObservableCollection<MachineVersion> MachineVersions + { + get + { + return _machineversions; + } + + set + { + _machineversions = value; RaisePropertyChanged(nameof(MachineVersions)); + } + + } + + private ICollectionView _machineversionsViewSource; + /// <summary> + /// Gets or sets the MachineVersions View Source. + ///</summary> + public ICollectionView MachineVersionsViewSource + { + get + { + return _machineversionsViewSource; + } + + set + { + _machineversionsViewSource = value; RaisePropertyChanged(nameof(MachineVersionsViewSource)); + } + + } + + private ObservableCollection<Machine> _machines; + /// <summary> + /// Gets or sets the Machines. + /// </summary> + public ObservableCollection<Machine> Machines + { + get + { + return _machines; + } + + set + { + _machines = value; RaisePropertyChanged(nameof(Machines)); + } + + } + + private ICollectionView _machinesViewSource; + /// <summary> + /// Gets or sets the Machines View Source. + ///</summary> + public ICollectionView MachinesViewSource + { + get + { + return _machinesViewSource; + } + + set + { + _machinesViewSource = value; RaisePropertyChanged(nameof(MachinesViewSource)); + } + + } + + private ObservableCollection<MachinesConfiguration> _machinesconfigurations; + /// <summary> + /// Gets or sets the MachinesConfigurations. + /// </summary> + public ObservableCollection<MachinesConfiguration> MachinesConfigurations + { + get + { + return _machinesconfigurations; + } + + set + { + _machinesconfigurations = value; RaisePropertyChanged(nameof(MachinesConfigurations)); + } + + } + + private ICollectionView _machinesconfigurationsViewSource; + /// <summary> + /// Gets or sets the MachinesConfigurations View Source. + ///</summary> + public ICollectionView MachinesConfigurationsViewSource + { + get + { + return _machinesconfigurationsViewSource; + } + + set + { + _machinesconfigurationsViewSource = value; RaisePropertyChanged(nameof(MachinesConfigurationsViewSource)); + } + + } + + private ObservableCollection<MachinesEvent> _machinesevents; + /// <summary> + /// Gets or sets the MachinesEvents. + /// </summary> + public ObservableCollection<MachinesEvent> MachinesEvents + { + get + { + return _machinesevents; + } + + set + { + _machinesevents = value; RaisePropertyChanged(nameof(MachinesEvents)); + } + + } + + private ICollectionView _machineseventsViewSource; + /// <summary> + /// Gets or sets the MachinesEvents View Source. + ///</summary> + public ICollectionView MachinesEventsViewSource + { + get + { + return _machineseventsViewSource; + } + + set + { + _machineseventsViewSource = value; RaisePropertyChanged(nameof(MachinesEventsViewSource)); + } + + } + + private ObservableCollection<MediaColor> _mediacolors; + /// <summary> + /// Gets or sets the MediaColors. + /// </summary> + public ObservableCollection<MediaColor> MediaColors + { + get + { + return _mediacolors; + } + + set + { + _mediacolors = value; RaisePropertyChanged(nameof(MediaColors)); + } + + } + + private ICollectionView _mediacolorsViewSource; + /// <summary> + /// Gets or sets the MediaColors View Source. + ///</summary> + public ICollectionView MediaColorsViewSource + { + get + { + return _mediacolorsViewSource; + } + + set + { + _mediacolorsViewSource = value; RaisePropertyChanged(nameof(MediaColorsViewSource)); + } + + } + + private ObservableCollection<MediaCondition> _mediaconditions; + /// <summary> + /// Gets or sets the MediaConditions. + /// </summary> + public ObservableCollection<MediaCondition> MediaConditions + { + get + { + return _mediaconditions; + } + + set + { + _mediaconditions = value; RaisePropertyChanged(nameof(MediaConditions)); + } + + } + + private ICollectionView _mediaconditionsViewSource; + /// <summary> + /// Gets or sets the MediaConditions View Source. + ///</summary> + public ICollectionView MediaConditionsViewSource + { + get + { + return _mediaconditionsViewSource; + } + + set + { + _mediaconditionsViewSource = value; RaisePropertyChanged(nameof(MediaConditionsViewSource)); + } + + } + + private ObservableCollection<MediaMaterial> _mediamaterials; + /// <summary> + /// Gets or sets the MediaMaterials. + /// </summary> + public ObservableCollection<MediaMaterial> MediaMaterials + { + get + { + return _mediamaterials; + } + + set + { + _mediamaterials = value; RaisePropertyChanged(nameof(MediaMaterials)); + } + + } + + private ICollectionView _mediamaterialsViewSource; + /// <summary> + /// Gets or sets the MediaMaterials View Source. + ///</summary> + public ICollectionView MediaMaterialsViewSource + { + get + { + return _mediamaterialsViewSource; + } + + set + { + _mediamaterialsViewSource = value; RaisePropertyChanged(nameof(MediaMaterialsViewSource)); + } + + } + + private ObservableCollection<MediaPurpos> _mediapurposes; + /// <summary> + /// Gets or sets the MediaPurposes. + /// </summary> + public ObservableCollection<MediaPurpos> MediaPurposes + { + get + { + return _mediapurposes; + } + + set + { + _mediapurposes = value; RaisePropertyChanged(nameof(MediaPurposes)); + } + + } + + private ICollectionView _mediapurposesViewSource; + /// <summary> + /// Gets or sets the MediaPurposes View Source. + ///</summary> + public ICollectionView MediaPurposesViewSource + { + get + { + return _mediapurposesViewSource; + } + + set + { + _mediapurposesViewSource = value; RaisePropertyChanged(nameof(MediaPurposesViewSource)); + } + + } + + private ObservableCollection<Organization> _organizations; + /// <summary> + /// Gets or sets the Organizations. + /// </summary> + public ObservableCollection<Organization> Organizations + { + get + { + return _organizations; + } + + set + { + _organizations = value; RaisePropertyChanged(nameof(Organizations)); + } + + } + + private ICollectionView _organizationsViewSource; + /// <summary> + /// Gets or sets the Organizations View Source. + ///</summary> + public ICollectionView OrganizationsViewSource + { + get + { + return _organizationsViewSource; + } + + set + { + _organizationsViewSource = value; RaisePropertyChanged(nameof(OrganizationsViewSource)); + } + + } + + private ObservableCollection<Permission> _permissions; + /// <summary> + /// Gets or sets the Permissions. + /// </summary> + public ObservableCollection<Permission> Permissions + { + get + { + return _permissions; + } + + set + { + _permissions = value; RaisePropertyChanged(nameof(Permissions)); + } + + } + + private ICollectionView _permissionsViewSource; + /// <summary> + /// Gets or sets the Permissions View Source. + ///</summary> + public ICollectionView PermissionsViewSource + { + get + { + return _permissionsViewSource; + } + + set + { + _permissionsViewSource = value; RaisePropertyChanged(nameof(PermissionsViewSource)); + } + + } + + private ObservableCollection<Rml> _rmls; + /// <summary> + /// Gets or sets the Rmls. + /// </summary> + public ObservableCollection<Rml> Rmls + { + get + { + return _rmls; + } + + set + { + _rmls = value; RaisePropertyChanged(nameof(Rmls)); + } + + } + + private ICollectionView _rmlsViewSource; + /// <summary> + /// Gets or sets the Rmls View Source. + ///</summary> + public ICollectionView RmlsViewSource + { + get + { + return _rmlsViewSource; + } + + set + { + _rmlsViewSource = value; RaisePropertyChanged(nameof(RmlsViewSource)); + } + + } + + private ObservableCollection<Role> _roles; + /// <summary> + /// Gets or sets the Roles. + /// </summary> + public ObservableCollection<Role> Roles + { + get + { + return _roles; + } + + set + { + _roles = value; RaisePropertyChanged(nameof(Roles)); + } + + } + + private ICollectionView _rolesViewSource; + /// <summary> + /// Gets or sets the Roles View Source. + ///</summary> + public ICollectionView RolesViewSource + { + get + { + return _rolesViewSource; + } + + set + { + _rolesViewSource = value; RaisePropertyChanged(nameof(RolesViewSource)); + } + + } + + private ObservableCollection<RolesPermission> _rolespermissions; + /// <summary> + /// Gets or sets the RolesPermissions. + /// </summary> + public ObservableCollection<RolesPermission> RolesPermissions + { + get + { + return _rolespermissions; + } + + set + { + _rolespermissions = value; RaisePropertyChanged(nameof(RolesPermissions)); + } + + } + + private ICollectionView _rolespermissionsViewSource; + /// <summary> + /// Gets or sets the RolesPermissions View Source. + ///</summary> + public ICollectionView RolesPermissionsViewSource + { + get + { + return _rolespermissionsViewSource; + } + + set + { + _rolespermissionsViewSource = value; RaisePropertyChanged(nameof(RolesPermissionsViewSource)); + } + + } + + private ObservableCollection<SyncConfiguration> _syncconfigurations; + /// <summary> + /// Gets or sets the SyncConfigurations. + /// </summary> + public ObservableCollection<SyncConfiguration> SyncConfigurations + { + get + { + return _syncconfigurations; + } + + set + { + _syncconfigurations = value; RaisePropertyChanged(nameof(SyncConfigurations)); + } + + } + + private ICollectionView _syncconfigurationsViewSource; + /// <summary> + /// Gets or sets the SyncConfigurations View Source. + ///</summary> + public ICollectionView SyncConfigurationsViewSource + { + get + { + return _syncconfigurationsViewSource; + } + + set + { + _syncconfigurationsViewSource = value; RaisePropertyChanged(nameof(SyncConfigurationsViewSource)); + } + + } + + private ObservableCollection<User> _users; + /// <summary> + /// Gets or sets the Users. + /// </summary> + public ObservableCollection<User> Users + { + get + { + return _users; + } + + set + { + _users = value; RaisePropertyChanged(nameof(Users)); + } + + } + + private ICollectionView _usersViewSource; + /// <summary> + /// Gets or sets the Users View Source. + ///</summary> + public ICollectionView UsersViewSource + { + get + { + return _usersViewSource; + } + + set + { + _usersViewSource = value; RaisePropertyChanged(nameof(UsersViewSource)); + } + + } + + private ObservableCollection<UsersRole> _usersroles; + /// <summary> + /// Gets or sets the UsersRoles. + /// </summary> + public ObservableCollection<UsersRole> UsersRoles + { + get + { + return _usersroles; + } + + set + { + _usersroles = value; RaisePropertyChanged(nameof(UsersRoles)); + } + + } + + private ICollectionView _usersrolesViewSource; + /// <summary> + /// Gets or sets the UsersRoles View Source. + ///</summary> + public ICollectionView UsersRolesViewSource + { + get + { + return _usersrolesViewSource; + } + + set + { + _usersrolesViewSource = value; RaisePropertyChanged(nameof(UsersRolesViewSource)); + } + + } + + /// <summary> + /// Initialize collection sources. + /// </summary> + private void InitCollectionSources() + { + + ActionsViewSource = CreateCollectionView(Actions); + + AddressesViewSource = CreateCollectionView(Addresses); + + ApplicationDisplayPanelVersionsViewSource = CreateCollectionView(ApplicationDisplayPanelVersions); + + ApplicationFirmwareVersionsViewSource = CreateCollectionView(ApplicationFirmwareVersions); + + ApplicationOsVersionsViewSource = CreateCollectionView(ApplicationOsVersions); + + ApplicationVersionsViewSource = CreateCollectionView(ApplicationVersions); + + CartridgeTypesViewSource = CreateCollectionView(CartridgeTypes); + + CartridgesViewSource = CreateCollectionView(Cartridges); + + ConfigurationsViewSource = CreateCollectionView(Configurations); + + ContactsViewSource = CreateCollectionView(Contacts); + + DispenserTypesViewSource = CreateCollectionView(DispenserTypes); + + DispensersViewSource = CreateCollectionView(Dispensers); + + EmbeddedFirmwareVersionsViewSource = CreateCollectionView(EmbeddedFirmwareVersions); + + EmbeddedSoftwareVersionsViewSource = CreateCollectionView(EmbeddedSoftwareVersions); + + EventsViewSource = CreateCollectionView(Events); + + EventsActionsViewSource = CreateCollectionView(EventsActions); + + FiberShapesViewSource = CreateCollectionView(FiberShapes); + + FiberSynthsViewSource = CreateCollectionView(FiberSynths); + + HardwareVersionsViewSource = CreateCollectionView(HardwareVersions); + + IdsPacksViewSource = CreateCollectionView(IdsPacks); + + LinearMassDensityUnitsViewSource = CreateCollectionView(LinearMassDensityUnits); + + LiquidsViewSource = CreateCollectionView(Liquids); + + LiquidsRmlsViewSource = CreateCollectionView(LiquidsRmls); + + MachineVersionsViewSource = CreateCollectionView(MachineVersions); + + MachinesViewSource = CreateCollectionView(Machines); + + MachinesConfigurationsViewSource = CreateCollectionView(MachinesConfigurations); + + MachinesEventsViewSource = CreateCollectionView(MachinesEvents); + + MediaColorsViewSource = CreateCollectionView(MediaColors); + + MediaConditionsViewSource = CreateCollectionView(MediaConditions); + + MediaMaterialsViewSource = CreateCollectionView(MediaMaterials); + + MediaPurposesViewSource = CreateCollectionView(MediaPurposes); + + OrganizationsViewSource = CreateCollectionView(Organizations); + + PermissionsViewSource = CreateCollectionView(Permissions); + + RmlsViewSource = CreateCollectionView(Rmls); + + RolesViewSource = CreateCollectionView(Roles); + + RolesPermissionsViewSource = CreateCollectionView(RolesPermissions); + + SyncConfigurationsViewSource = CreateCollectionView(SyncConfigurations); + + UsersViewSource = CreateCollectionView(Users); + + UsersRolesViewSource = CreateCollectionView(UsersRoles); + + } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesGenerator.cs b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesGenerator.cs index 8bce28920..b6788ccfe 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesGenerator.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesGenerator.cs @@ -1,25 +1,29 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Data.Entity; using System.IO; using System.Linq; +using System.Reflection; using System.Text; using System.Threading.Tasks; using Tango.CodeGeneration; using Tango.DAL.Remote.DB; using Tango.Settings; +using Humanizer; namespace Tango.DAL.Observables { public class ObservablesGenerator { - public void Generate(String targetPath) + public void GenerateCSharp(String targetPath) { + //Generate Entities... foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType))) { - EntityCodeFile codeFile = new EntityCodeFile(ObservableEntity.DalNameToStandardName(table.Name).Singularize()) + EntityCodeFile codeFile = new EntityCodeFile(ObservableEntity.DalNameToStandardName(table.Name).SingularizeMVC()) { - EntityName = table.Name.Singularize(), + EntityName = table.Name.SingularizeMVC(), TableName = table.Name, }; @@ -33,14 +37,14 @@ namespace Tango.DAL.Observables if (field.PropertyType.IsGenericType) { - codeField.Type = String.Format("ObservableCollection<{0}>", ObservableEntity.DalNameToStandardName(field.PropertyType.GenericTypeArguments.Single().Name).Singularize()); + codeField.Type = String.Format("ObservableCollection<{0}>", ObservableEntity.DalNameToStandardName(field.PropertyType.GenericTypeArguments.Single().Name).SingularizeMVC()); codeField.Construct = true; } else { if (field.PropertyType.IsClass && field.PropertyType != typeof(String)) { - codeField.Type = ObservableEntity.DalNameToStandardName(field.PropertyType.Name).Singularize(); + codeField.Type = ObservableEntity.DalNameToStandardName(field.PropertyType.Name).SingularizeMVC(); } else { @@ -52,42 +56,195 @@ namespace Tango.DAL.Observables String code = codeFile.GenerateCode(); - File.WriteAllText(Path.Combine(targetPath, codeFile.Name + ".cs"), code); + String entitiesPath = Path.Combine(targetPath, "Entities"); + Directory.CreateDirectory(entitiesPath); + File.WriteAllText(Path.Combine(entitiesPath, codeFile.Name + ".cs"), code); } + //Generate Entities... //Generate Enumerations... using (RemoteDB db = new RemoteDB(SettingsManager.Default.DataBase.SQLServerAddress, false)) { - EnumerationFile enumFile = new EnumerationFile(); - enumFile.Name = "RolesEnum"; + foreach (var tableProp in db.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsGenericType)) + { + try + { + var a = tableProp.PropertyType.GenericTypeArguments.FirstOrDefault(); + var codeProp = tableProp.PropertyType.GenericTypeArguments.First().GetProperty("CODE"); + var nameProp = tableProp.PropertyType.GenericTypeArguments.First().GetProperty("NAME"); + var descriptionProp = tableProp.PropertyType.GenericTypeArguments.First().GetProperty("DESCRIPTION"); + + if (codeProp != null && nameProp != null) + { + EnumerationFile enumFile = new EnumerationFile(); + enumFile.Name = ObservableEntity.DalNameToStandardName(tableProp.Name); + + foreach (var row in tableProp.GetValue(db) as IEnumerable) + { + EnumerationField field = new EnumerationField(); + field.Name = nameProp.GetValue(row).ToString().Replace(" ", ""); + field.Value = (int)codeProp.GetValue(row); + + if (descriptionProp != null) + { + field.Description = descriptionProp.GetValue(row).ToString(); + } + else + { + field.Description = nameProp.GetValue(row).ToString(); + } + enumFile.Fields.Add(field); + } + + String enumerationsPath = Path.Combine(targetPath, "Enumerations"); + Directory.CreateDirectory(enumerationsPath); + String code = enumFile.GenerateCode(); + File.WriteAllText(Path.Combine(enumerationsPath, enumFile.Name + ".cs"), code); + } + } + catch { } + } + } + //Generate Enumerations... - foreach (var row in db.ROLES) + //Generate Observables Adapter Extensions... + ObservablesAdapterFile adapterFile = new ObservablesAdapterFile(); + adapterFile.Name = nameof(ObservablesEntitiesAdapter); + + foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType))) + { + adapterFile.Properties.Add(new Property() { - EnumerationField field = new EnumerationField(); - field.Name = row.NAME.Replace(" ", ""); - field.Description = row.DESCRIPTION; - field.Value = row.CODE; - enumFile.Fields.Add(field); + Name = ObservableEntity.DalNameToStandardName(table.Name), + Type = String.Format("ObservableCollection<{0}>", ObservableEntity.DalNameToStandardName(table.PropertyType.GenericTypeArguments.Single().Name).SingularizeMVC()), + }); + } + + String adapterCode = adapterFile.GenerateCode(); + File.WriteAllText(Path.Combine(targetPath, "ObservablesEntitiesAdapterExtension.cs"), adapterCode); + //Generate Observables Adapter Extensions... + } + + public void GenerateJava(String targetPath) + { + //Generate Entities... + foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType))) + { + EntityCodeFileJava codeFile = new EntityCodeFileJava(ObservableEntity.DalNameToStandardName(table.Name).Singularize(false)) + { + EntityName = table.Name.Singularize(false), + TableName = table.Name, + }; + + + + foreach (var field in table.PropertyType.GenericTypeArguments.First().GetProperties().Skip(4).Where(x => !x.Name.Contains("GUID"))) + { + EntityCodeFileField codeField = new EntityCodeFileField(); + codeField.FieldName = field.Name.Singularize(false); + codeField.Name = ObservableEntity.DalNameToStandardName(field.Name.Singularize(false)); + codeField.Description = FirstCharacterToLower(ObservableEntity.DalNameToStandardName(field.Name).Singularize(false)); + + + if (field.PropertyType.IsGenericType) + { + continue; + } + else + { + if (field.PropertyType.IsClass && field.PropertyType != typeof(String)) + { + codeField.Type = ObservableEntity.DalNameToStandardName(field.PropertyType.Name).Singularize(false); + codeField.Construct = true; + } + else + { + codeField.Type = field.PropertyType.Name == "Int32" ? "int" : field.PropertyType.Name; + } + } + codeFile.Fields.Add(codeField); } - String code = enumFile.GenerateCode(); - File.WriteAllText(Path.Combine(targetPath, enumFile.Name + ".cs"), code); + codeFile.IndentResult = false; + String code = codeFile.GenerateCode(); - enumFile = new EnumerationFile(); - enumFile.Name = "PermissionsEnum"; + String entitiesPath = Path.Combine(targetPath, "entities"); + Directory.CreateDirectory(entitiesPath); + File.WriteAllText(Path.Combine(entitiesPath, codeFile.Name + ".java"), code); + } + //Generate Entities... - foreach (var row in db.PERMISSIONS) + //Generate Enumerations... + using (RemoteDB db = new RemoteDB(SettingsManager.Default.DataBase.SQLServerAddress, false)) + { + foreach (var tableProp in db.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsGenericType)) { - EnumerationField field = new EnumerationField(); - field.Name = row.NAME.Replace(" ", ""); - field.Description = row.DESCRIPTION; - field.Value = row.CODE; - enumFile.Fields.Add(field); + try + { + var a = tableProp.PropertyType.GenericTypeArguments.FirstOrDefault(); + var codeProp = tableProp.PropertyType.GenericTypeArguments.First().GetProperty("CODE"); + var nameProp = tableProp.PropertyType.GenericTypeArguments.First().GetProperty("NAME"); + var descriptionProp = tableProp.PropertyType.GenericTypeArguments.First().GetProperty("DESCRIPTION"); + + if (codeProp != null && nameProp != null) + { + EnumerationFileJava enumFile = new EnumerationFileJava(); + enumFile.Name = ObservableEntity.DalNameToStandardName(tableProp.Name); + + foreach (var row in tableProp.GetValue(db) as IEnumerable) + { + EnumerationField field = new EnumerationField(); + field.Name = nameProp.GetValue(row).ToString().Replace(" ", ""); + field.Value = (int)codeProp.GetValue(row); + + if (descriptionProp != null) + { + field.Description = descriptionProp.GetValue(row).ToString(); + } + else + { + field.Description = nameProp.GetValue(row).ToString(); + } + enumFile.Fields.Add(field); + } + + String enumerationsPath = Path.Combine(targetPath, "enumerations"); + Directory.CreateDirectory(enumerationsPath); + String code = enumFile.GenerateCode(); + File.WriteAllText(Path.Combine(enumerationsPath, enumFile.Name + ".java"), code); + } + } + catch { } } + } + //Generate Enumerations... + + //Generate DAO... + TangoDAOJavaFile daoFile = new TangoDAOJavaFile(); + daoFile.Name = "TangoDAO"; - code = enumFile.GenerateCode(); - File.WriteAllText(Path.Combine(targetPath, enumFile.Name + ".cs"), code); + foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType))) + { + daoFile.Entities.Add(new TangoDAOJavaFile.TangoDAOEntity() + { + Name = ObservableEntity.DalNameToStandardName(table.Name).Singularize(false), + TableName = ObservableEntity.DalNameToStandardName(table.Name), + }); } + + String daoCode = daoFile.GenerateCode(); + String daoFolder = Path.Combine(targetPath, "dao"); + Directory.CreateDirectory(daoFolder); + File.WriteAllText(Path.Combine(daoFolder, "TangoDAO.java"), daoCode); + //Generate DAO... + } + + private static string FirstCharacterToLower(string str) + { + if (String.IsNullOrEmpty(str) || Char.IsLower(str, 0)) + return str; + + return Char.ToLowerInvariant(str[0]) + str.Substring(1); } } } diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj b/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj index 5a8921a2d..69f4670ba 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj +++ b/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj @@ -36,6 +36,9 @@ <Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> <HintPath>..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll</HintPath> </Reference> + <Reference Include="Humanizer, Version=2.2.0.0, Culture=neutral, PublicKeyToken=979442b78dfc278e, processorArchitecture=MSIL"> + <HintPath>..\packages\Humanizer.Core.2.2.0\lib\netstandard1.0\Humanizer.dll</HintPath> + </Reference> <Reference Include="PresentationFramework" /> <Reference Include="System" /> <Reference Include="System.ComponentModel.DataAnnotations" /> @@ -53,14 +56,27 @@ <Compile Include="..\Versioning\GlobalVersionInfo.cs"> <Link>GlobalVersionInfo.cs</Link> </Compile> - <Compile Include="Entities\PermissionsEnum.cs" /> - <Compile Include="Entities\RolesEnum.cs" /> + <Compile Include="Entities\FiberSynth.cs" /> <Compile Include="EntityFieldNameAttribute.cs" /> + <Compile Include="Enumerations\Actions.cs" /> + <Compile Include="Enumerations\CartridgeTypes.cs" /> + <Compile Include="Enumerations\DispenserTypes.cs" /> + <Compile Include="Enumerations\Events.cs" /> + <Compile Include="Enumerations\FiberShapes.cs" /> + <Compile Include="Enumerations\FiberSynthesises.cs" /> + <Compile Include="Enumerations\LinearMassDensityUnits.cs" /> + <Compile Include="Enumerations\Liquids.cs" /> + <Compile Include="Enumerations\MediaConditions.cs" /> + <Compile Include="Enumerations\MediaMaterials.cs" /> + <Compile Include="Enumerations\MediaPurposes.cs" /> + <Compile Include="Enumerations\Permissions.cs" /> + <Compile Include="Enumerations\Roles.cs" /> <Compile Include="ExtensionMethods.cs" /> <Compile Include="IObservableEntity.cs" /> <Compile Include="LoadedObjectsService.cs" /> <Compile Include="ObservableEntity.cs" /> <Compile Include="ObservablesEntitiesAdapter.cs" /> + <Compile Include="ObservablesEntitiesAdapterExtension.cs" /> <Compile Include="ObservablesGenerator.cs" /> <Compile Include="Entities\Action.cs" /> <Compile Include="Entities\Address.cs" /> @@ -79,7 +95,6 @@ <Compile Include="Entities\Event.cs" /> <Compile Include="Entities\EventsAction.cs" /> <Compile Include="Entities\FiberShape.cs" /> - <Compile Include="Entities\FiberSynthesis.cs" /> <Compile Include="Entities\HardwareVersion.cs" /> <Compile Include="Entities\IdsPack.cs" /> <Compile Include="Entities\LinearMassDensityUnit.cs" /> @@ -89,7 +104,6 @@ <Compile Include="Entities\MachinesConfiguration.cs" /> <Compile Include="Entities\MachinesEvent.cs" /> <Compile Include="Entities\MachineVersion.cs" /> - <Compile Include="Entities\MachineVersionsConfiguration.cs" /> <Compile Include="Entities\MediaColor.cs" /> <Compile Include="Entities\MediaCondition.cs" /> <Compile Include="Entities\MediaMaterial.cs" /> @@ -133,6 +147,6 @@ </PreBuildEvent> </PropertyGroup> <PropertyGroup> - <PostBuildEvent>"$(TargetDir)dbobgen.exe" "$(SolutionDir)Tango.DAL.Observables\Entities"</PostBuildEvent> + <PostBuildEvent>"$(TargetDir)dbobgen.exe" "$(SolutionDir)Tango.DAL.Observables" -csharp</PostBuildEvent> </PropertyGroup> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Observables/packages.config b/Software/Visual_Studio/Tango.DAL.Observables/packages.config index 9256e1591..5148e8474 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/packages.config +++ b/Software/Visual_Studio/Tango.DAL.Observables/packages.config @@ -1,4 +1,46 @@ <?xml version="1.0" encoding="utf-8"?> <packages> <package id="EntityFramework" version="6.0.0" targetFramework="net46" /> + <package id="Humanizer" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.af" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.ar" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.bg" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.bn-BD" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.cs" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.da" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.de" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.el" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.es" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.fa" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.fi-FI" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.fr" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.fr-BE" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.he" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.hr" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.hu" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.id" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.it" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.ja" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.lv" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.nb" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.nb-NO" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.nl" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.pl" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.pt" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.ro" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.ru" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.sk" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.sl" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.sr" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.sr-Latn" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.sv" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.tr" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.uk" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.uz-Cyrl-UZ" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.uz-Latn-UZ" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.vi" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.zh-CN" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.zh-Hans" version="2.2.0" targetFramework="net46" /> + <package id="Humanizer.Core.zh-Hant" version="2.2.0" targetFramework="net46" /> </packages>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_DISPLAY_PANEL_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_DISPLAY_PANEL_VERSIONS.cs index 703011569..5d5c329e0 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_DISPLAY_PANEL_VERSIONS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_DISPLAY_PANEL_VERSIONS.cs @@ -24,6 +24,8 @@ namespace Tango.DAL.Remote.DB public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } + public double VERSION { get; set; } + public string NAME { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<CONFIGURATION> CONFIGURATIONS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_FIRMWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_FIRMWARE_VERSIONS.cs index c1c51b057..249dcfe2b 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_FIRMWARE_VERSIONS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_FIRMWARE_VERSIONS.cs @@ -24,6 +24,8 @@ namespace Tango.DAL.Remote.DB public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } + public double VERSION { get; set; } + public string NAME { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<CONFIGURATION> CONFIGURATIONS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_OS_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_OS_VERSIONS.cs index 4c0535134..677e7f099 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_OS_VERSIONS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_OS_VERSIONS.cs @@ -24,6 +24,8 @@ namespace Tango.DAL.Remote.DB public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } + public double VERSION { get; set; } + public string NAME { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<CONFIGURATION> CONFIGURATIONS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_VERSIONS.cs index beeb8c59e..f5f0d29aa 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_VERSIONS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/APPLICATION_VERSIONS.cs @@ -24,6 +24,8 @@ namespace Tango.DAL.Remote.DB public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } + public double VERSION { get; set; } + public string NAME { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<CONFIGURATION> CONFIGURATIONS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/CARTRIDGE.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/CARTRIDGE.cs index 282117f7f..9aea9e037 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/CARTRIDGE.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/CARTRIDGE.cs @@ -24,6 +24,7 @@ namespace Tango.DAL.Remote.DB public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } + public string SERIAL_NUMBER { get; set; } public string CARTRIDGE_TYPE_GUID { get; set; } public virtual CARTRIDGE_TYPES CARTRIDGE_TYPES { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/CARTRIDGE_TYPES.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/CARTRIDGE_TYPES.cs index 5962542b0..c5c4227c5 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/CARTRIDGE_TYPES.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/CARTRIDGE_TYPES.cs @@ -24,6 +24,8 @@ namespace Tango.DAL.Remote.DB public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } + public int CODE { get; set; } + public string NAME { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<CARTRIDGE> CARTRIDGES { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/CONFIGURATION.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/CONFIGURATION.cs index 6afa03afd..041e8a403 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/CONFIGURATION.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/CONFIGURATION.cs @@ -18,7 +18,7 @@ namespace Tango.DAL.Remote.DB public CONFIGURATION() { this.IDS_PACKS = new HashSet<IDS_PACKS>(); - this.MACHINE_VERSIONS_CONFIGURATIONS = new HashSet<MACHINE_VERSIONS_CONFIGURATIONS>(); + this.MACHINE_VERSIONS = new HashSet<MACHINE_VERSIONS>(); this.MACHINES_CONFIGURATIONS = new HashSet<MACHINES_CONFIGURATIONS>(); } @@ -40,13 +40,13 @@ namespace Tango.DAL.Remote.DB public virtual APPLICATION_FIRMWARE_VERSIONS APPLICATION_FIRMWARE_VERSIONS { get; set; } public virtual APPLICATION_OS_VERSIONS APPLICATION_OS_VERSIONS { get; set; } public virtual APPLICATION_VERSIONS APPLICATION_VERSIONS { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection<IDS_PACKS> IDS_PACKS { get; set; } public virtual EMBEDDED_FIRMWARE_VERSIONS EMBEDDED_FIRMWARE_VERSIONS { get; set; } public virtual EMBEDDED_SOFTWARE_VERSIONS EMBEDDED_SOFTWARE_VERSIONS { get; set; } public virtual HARDWARE_VERSIONS HARDWARE_VERSIONS { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection<MACHINE_VERSIONS_CONFIGURATIONS> MACHINE_VERSIONS_CONFIGURATIONS { get; set; } + public virtual ICollection<IDS_PACKS> IDS_PACKS { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection<MACHINE_VERSIONS> MACHINE_VERSIONS { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<MACHINES_CONFIGURATIONS> MACHINES_CONFIGURATIONS { get; set; } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/DISPENSER.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/DISPENSER.cs index d93806560..60df18ed3 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/DISPENSER.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/DISPENSER.cs @@ -24,6 +24,7 @@ namespace Tango.DAL.Remote.DB public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } + public string SERIAL_NUMBER { get; set; } public string DISPENSER_TYPE_GUID { get; set; } public virtual DISPENSER_TYPES DISPENSER_TYPES { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/DISPENSER_TYPES.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/DISPENSER_TYPES.cs index 29996cd88..c474764b8 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/DISPENSER_TYPES.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/DISPENSER_TYPES.cs @@ -24,6 +24,8 @@ namespace Tango.DAL.Remote.DB public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } + public int CODE { get; set; } + public string NAME { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<DISPENSER> DISPENSERS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/EMBEDDED_FIRMWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/EMBEDDED_FIRMWARE_VERSIONS.cs index 2c251b5e2..2ebc41626 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/EMBEDDED_FIRMWARE_VERSIONS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/EMBEDDED_FIRMWARE_VERSIONS.cs @@ -24,6 +24,8 @@ namespace Tango.DAL.Remote.DB public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } + public double VERSION { get; set; } + public string NAME { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<CONFIGURATION> CONFIGURATIONS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/EMBEDDED_SOFTWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/EMBEDDED_SOFTWARE_VERSIONS.cs index 5e1546b20..470cbaa49 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/EMBEDDED_SOFTWARE_VERSIONS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/EMBEDDED_SOFTWARE_VERSIONS.cs @@ -24,6 +24,8 @@ namespace Tango.DAL.Remote.DB public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } + public double VERSION { get; set; } + public string NAME { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<CONFIGURATION> CONFIGURATIONS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/FIBER_SYNTHESISES.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/FIBER_SYNTHS.cs index 551041fa3..885eff2c7 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/FIBER_SYNTHESISES.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/FIBER_SYNTHS.cs @@ -12,10 +12,10 @@ namespace Tango.DAL.Remote.DB using System; using System.Collections.Generic; - public partial class FIBER_SYNTHESISES + public partial class FIBER_SYNTHS { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public FIBER_SYNTHESISES() + public FIBER_SYNTHS() { this.RMLS = new HashSet<RML>(); } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_VERSIONS.cs index 237448341..ba114fe3c 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_VERSIONS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_VERSIONS.cs @@ -24,6 +24,8 @@ namespace Tango.DAL.Remote.DB public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } + public double VERSION { get; set; } + public string NAME { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<CONFIGURATION> CONFIGURATIONS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/IDS_PACKS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/IDS_PACKS.cs index a29ec7795..3f9a3da78 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/IDS_PACKS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/IDS_PACKS.cs @@ -22,6 +22,7 @@ namespace Tango.DAL.Remote.DB public string DISPENSER_GUID { get; set; } public string LIQUID_GUID { get; set; } public string CARTRIDGE_GUID { get; set; } + public string NAME { get; set; } public virtual CARTRIDGE CARTRIDGE { get; set; } public virtual CONFIGURATION CONFIGURATION { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/LIQUID.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/LIQUID.cs index 85bded1c8..b6a4ce67c 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/LIQUID.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/LIQUID.cs @@ -28,6 +28,7 @@ namespace Tango.DAL.Remote.DB public int CODE { get; set; } public string NAME { get; set; } public double VERSION { get; set; } + public int COLOR { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<IDS_PACKS> IDS_PACKS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_VERSIONS.cs index bb4ef6e58..a93d8e5b8 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_VERSIONS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_VERSIONS.cs @@ -17,7 +17,6 @@ namespace Tango.DAL.Remote.DB [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public MACHINE_VERSIONS() { - this.MACHINE_VERSIONS_CONFIGURATIONS = new HashSet<MACHINE_VERSIONS_CONFIGURATIONS>(); this.MACHINES = new HashSet<MACHINE>(); } @@ -26,9 +25,10 @@ namespace Tango.DAL.Remote.DB public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } public double VERSION { get; set; } + public string NAME { get; set; } + public string DEFAULT_CONFIGURATION_GUID { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection<MACHINE_VERSIONS_CONFIGURATIONS> MACHINE_VERSIONS_CONFIGURATIONS { get; set; } + public virtual CONFIGURATION CONFIGURATION { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<MACHINE> MACHINES { get; set; } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_VERSIONS_CONFIGURATIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_VERSIONS_CONFIGURATIONS.cs deleted file mode 100644 index c0f440300..000000000 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_VERSIONS_CONFIGURATIONS.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Remote.DB -{ - using System; - using System.Collections.Generic; - - public partial class MACHINE_VERSIONS_CONFIGURATIONS - { - public int ID { get; set; } - public System.Guid GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - public string MACHINE_VERSION_GUID { get; set; } - public string CONFIGURATION_GUID { get; set; } - - public virtual CONFIGURATION CONFIGURATION { get; set; } - public virtual MACHINE_VERSIONS MACHINE_VERSIONS { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs index 89a4fe609..3e7ff1dd4 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs @@ -31,7 +31,7 @@ namespace Tango.DAL.Remote.DB public string CONDITION_GUID { get; set; } public string LINEAR_MASS_DENSITY_UNIT_GUID { get; set; } public string FIBER_SHAPE_GUID { get; set; } - public string FIBER_SYNTHESIS_GUID { get; set; } + public string FIBER_SYNTH_GUID { get; set; } public double FIBER_SIZE { get; set; } public int NUMBER_OF_FIBERS { get; set; } public int PLIES_PER_FIBER { get; set; } @@ -44,7 +44,7 @@ namespace Tango.DAL.Remote.DB public double ESTIMATED_THREAD_DIAMETER { get; set; } public virtual FIBER_SHAPES FIBER_SHAPES { get; set; } - public virtual FIBER_SYNTHESISES FIBER_SYNTHESISES { get; set; } + public virtual FIBER_SYNTHS FIBER_SYNTHS { get; set; } public virtual LINEAR_MASS_DENSITY_UNITS LINEAR_MASS_DENSITY_UNITS { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<LIQUIDS_RMLS> LIQUIDS_RMLS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs index 2da6d31b1..1122fee30 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs @@ -42,14 +42,13 @@ namespace Tango.DAL.Remote.DB public virtual DbSet<EVENT> EVENTS { get; set; } public virtual DbSet<EVENTS_ACTIONS> EVENTS_ACTIONS { get; set; } public virtual DbSet<FIBER_SHAPES> FIBER_SHAPES { get; set; } - public virtual DbSet<FIBER_SYNTHESISES> FIBER_SYNTHESISES { get; set; } + public virtual DbSet<FIBER_SYNTHS> FIBER_SYNTHS { get; set; } public virtual DbSet<HARDWARE_VERSIONS> HARDWARE_VERSIONS { get; set; } public virtual DbSet<IDS_PACKS> IDS_PACKS { get; set; } public virtual DbSet<LINEAR_MASS_DENSITY_UNITS> LINEAR_MASS_DENSITY_UNITS { get; set; } public virtual DbSet<LIQUID> LIQUIDS { get; set; } public virtual DbSet<LIQUIDS_RMLS> LIQUIDS_RMLS { get; set; } public virtual DbSet<MACHINE_VERSIONS> MACHINE_VERSIONS { get; set; } - public virtual DbSet<MACHINE_VERSIONS_CONFIGURATIONS> MACHINE_VERSIONS_CONFIGURATIONS { get; set; } public virtual DbSet<MACHINE> MACHINES { get; set; } public virtual DbSet<MACHINES_CONFIGURATIONS> MACHINES_CONFIGURATIONS { get; set; } public virtual DbSet<MACHINES_EVENTS> MACHINES_EVENTS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx index 618616584..d730ff6cc 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -41,6 +41,8 @@ <Property Name="GUID" Type="varchar" MaxLength="36" Nullable="false" /> <Property Name="LAST_UPDATED" Type="datetime" Nullable="false" /> <Property Name="DELETED" Type="bit" Nullable="false" /> + <Property Name="VERSION" Type="float" Nullable="false" /> + <Property Name="NAME" Type="nvarchar" MaxLength="50" Nullable="false" /> </EntityType> <EntityType Name="APPLICATION_FIRMWARE_VERSIONS"> <Key> @@ -50,6 +52,8 @@ <Property Name="GUID" Type="varchar" MaxLength="36" Nullable="false" /> <Property Name="LAST_UPDATED" Type="datetime" Nullable="false" /> <Property Name="DELETED" Type="bit" Nullable="false" /> + <Property Name="VERSION" Type="float" Nullable="false" /> + <Property Name="NAME" Type="nvarchar" MaxLength="50" Nullable="false" /> </EntityType> <EntityType Name="APPLICATION_OS_VERSIONS"> <Key> @@ -59,6 +63,8 @@ <Property Name="GUID" Type="varchar" MaxLength="36" Nullable="false" /> <Property Name="LAST_UPDATED" Type="datetime" Nullable="false" /> <Property Name="DELETED" Type="bit" Nullable="false" /> + <Property Name="VERSION" Type="float" Nullable="false" /> + <Property Name="NAME" Type="nvarchar" MaxLength="50" Nullable="false" /> </EntityType> <EntityType Name="APPLICATION_VERSIONS"> <Key> @@ -68,6 +74,8 @@ <Property Name="GUID" Type="varchar" MaxLength="36" Nullable="false" /> <Property Name="LAST_UPDATED" Type="datetime" Nullable="false" /> <Property Name="DELETED" Type="bit" Nullable="false" /> + <Property Name="VERSION" Type="float" Nullable="false" /> + <Property Name="NAME" Type="nvarchar" MaxLength="50" Nullable="false" /> </EntityType> <EntityType Name="CARTRIDGE_TYPES"> <Key> @@ -77,6 +85,8 @@ <Property Name="GUID" Type="varchar" MaxLength="36" Nullable="false" /> <Property Name="LAST_UPDATED" Type="datetime" Nullable="false" /> <Property Name="DELETED" Type="bit" Nullable="false" /> + <Property Name="CODE" Type="int" Nullable="false" /> + <Property Name="NAME" Type="nvarchar" MaxLength="50" Nullable="false" /> </EntityType> <EntityType Name="CARTRIDGES"> <Key> @@ -86,6 +96,7 @@ <Property Name="GUID" Type="varchar" MaxLength="36" Nullable="false" /> <Property Name="LAST_UPDATED" Type="datetime" Nullable="false" /> <Property Name="DELETED" Type="bit" Nullable="false" /> + <Property Name="SERIAL_NUMBER" Type="nvarchar" MaxLength="50" Nullable="false" /> <Property Name="CARTRIDGE_TYPE_GUID" Type="varchar" MaxLength="36" Nullable="false" /> </EntityType> <EntityType Name="CONFIGURATIONS"> @@ -129,6 +140,8 @@ <Property Name="GUID" Type="varchar" MaxLength="36" Nullable="false" /> <Property Name="LAST_UPDATED" Type="datetime" Nullable="false" /> <Property Name="DELETED" Type="bit" Nullable="false" /> + <Property Name="CODE" Type="int" Nullable="false" /> + <Property Name="NAME" Type="nvarchar" MaxLength="50" Nullable="false" /> </EntityType> <EntityType Name="DISPENSERS"> <Key> @@ -138,6 +151,7 @@ <Property Name="GUID" Type="varchar" MaxLength="36" Nullable="false" /> <Property Name="LAST_UPDATED" Type="datetime" Nullable="false" /> <Property Name="DELETED" Type="bit" Nullable="false" /> + <Property Name="SERIAL_NUMBER" Type="nvarchar" MaxLength="50" Nullable="false" /> <Property Name="DISPENSER_TYPE_GUID" Type="varchar" MaxLength="36" Nullable="false" /> </EntityType> <EntityType Name="EMBEDDED_FIRMWARE_VERSIONS"> @@ -148,6 +162,8 @@ <Property Name="GUID" Type="varchar" MaxLength="36" Nullable="false" /> <Property Name="LAST_UPDATED" Type="datetime" Nullable="false" /> <Property Name="DELETED" Type="bit" Nullable="false" /> + <Property Name="VERSION" Type="float" Nullable="false" /> + <Property Name="NAME" Type="nvarchar" MaxLength="50" Nullable="false" /> </EntityType> <EntityType Name="EMBEDDED_SOFTWARE_VERSIONS"> <Key> @@ -157,6 +173,8 @@ <Property Name="GUID" Type="varchar" MaxLength="36" Nullable="false" /> <Property Name="LAST_UPDATED" Type="datetime" Nullable="false" /> <Property Name="DELETED" Type="bit" Nullable="false" /> + <Property Name="VERSION" Type="float" Nullable="false" /> + <Property Name="NAME" Type="nvarchar" MaxLength="50" Nullable="false" /> </EntityType> <EntityType Name="EVENTS"> <Key> @@ -192,7 +210,7 @@ <Property Name="NAME" Type="nvarchar" MaxLength="50" Nullable="false" /> <Property Name="CODE" Type="int" Nullable="false" /> </EntityType> - <EntityType Name="FIBER_SYNTHESISES"> + <EntityType Name="FIBER_SYNTHS"> <Key> <PropertyRef Name="GUID" /> </Key> @@ -211,6 +229,8 @@ <Property Name="GUID" Type="varchar" MaxLength="36" Nullable="false" /> <Property Name="LAST_UPDATED" Type="datetime" Nullable="false" /> <Property Name="DELETED" Type="bit" Nullable="false" /> + <Property Name="VERSION" Type="float" Nullable="false" /> + <Property Name="NAME" Type="nvarchar" MaxLength="50" Nullable="false" /> </EntityType> <EntityType Name="IDS_PACKS"> <Key> @@ -224,6 +244,7 @@ <Property Name="DISPENSER_GUID" Type="varchar" MaxLength="36" Nullable="false" /> <Property Name="LIQUID_GUID" Type="varchar" MaxLength="36" Nullable="false" /> <Property Name="CARTRIDGE_GUID" Type="varchar" MaxLength="36" Nullable="false" /> + <Property Name="NAME" Type="nvarchar" MaxLength="50" Nullable="false" /> </EntityType> <EntityType Name="LINEAR_MASS_DENSITY_UNITS"> <Key> @@ -247,6 +268,7 @@ <Property Name="CODE" Type="int" Nullable="false" /> <Property Name="NAME" Type="nvarchar" MaxLength="50" Nullable="false" /> <Property Name="VERSION" Type="float" Nullable="false" /> + <Property Name="COLOR" Type="int" Nullable="false" /> </EntityType> <EntityType Name="LIQUIDS_RMLS"> <Key> @@ -268,17 +290,8 @@ <Property Name="LAST_UPDATED" Type="datetime" Nullable="false" /> <Property Name="DELETED" Type="bit" Nullable="false" /> <Property Name="VERSION" Type="float" Nullable="false" /> - </EntityType> - <EntityType Name="MACHINE_VERSIONS_CONFIGURATIONS"> - <Key> - <PropertyRef Name="GUID" /> - </Key> - <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" /> - <Property Name="GUID" Type="uniqueidentifier" Nullable="false" /> - <Property Name="LAST_UPDATED" Type="datetime" Nullable="false" /> - <Property Name="DELETED" Type="bit" Nullable="false" /> - <Property Name="MACHINE_VERSION_GUID" Type="varchar" MaxLength="36" Nullable="false" /> - <Property Name="CONFIGURATION_GUID" Type="varchar" MaxLength="36" Nullable="false" /> + <Property Name="NAME" Type="nvarchar" MaxLength="50" Nullable="false" /> + <Property Name="DEFAULT_CONFIGURATION_GUID" Type="varchar" MaxLength="36" Nullable="false" /> </EntityType> <EntityType Name="MACHINES"> <Key> @@ -401,7 +414,7 @@ <Property Name="CONDITION_GUID" Type="varchar" MaxLength="36" Nullable="false" /> <Property Name="LINEAR_MASS_DENSITY_UNIT_GUID" Type="varchar" MaxLength="36" Nullable="false" /> <Property Name="FIBER_SHAPE_GUID" Type="varchar" MaxLength="36" Nullable="false" /> - <Property Name="FIBER_SYNTHESIS_GUID" Type="varchar" MaxLength="36" Nullable="false" /> + <Property Name="FIBER_SYNTH_GUID" Type="varchar" MaxLength="36" Nullable="false" /> <Property Name="FIBER_SIZE" Type="float" Nullable="false" /> <Property Name="NUMBER_OF_FIBERS" Type="int" Nullable="false" /> <Property Name="PLIES_PER_FIBER" Type="int" Nullable="false" /> @@ -541,18 +554,6 @@ </Dependent> </ReferentialConstraint> </Association> - <Association Name="FK_CONFIGURATIONS_DISPENSERS_CONFIGURATIONS"> - <End Role="CONFIGURATIONS" Type="Self.CONFIGURATIONS" Multiplicity="1" /> - <End Role="IDS_PACKS" Type="Self.IDS_PACKS" Multiplicity="*" /> - <ReferentialConstraint> - <Principal Role="CONFIGURATIONS"> - <PropertyRef Name="GUID" /> - </Principal> - <Dependent Role="IDS_PACKS"> - <PropertyRef Name="DISPENSER_GUID" /> - </Dependent> - </ReferentialConstraint> - </Association> <Association Name="FK_CONFIGURATIONS_DISPENSERS_DISPENSERS"> <End Role="DISPENSERS" Type="Self.DISPENSERS" Multiplicity="1" /> <End Role="IDS_PACKS" Type="Self.IDS_PACKS" Multiplicity="*" /> @@ -649,6 +650,18 @@ </Dependent> </ReferentialConstraint> </Association> + <Association Name="FK_IDS_PACKS_CONFIGURATIONS"> + <End Role="CONFIGURATIONS" Type="Self.CONFIGURATIONS" Multiplicity="1" /> + <End Role="IDS_PACKS" Type="Self.IDS_PACKS" Multiplicity="*" /> + <ReferentialConstraint> + <Principal Role="CONFIGURATIONS"> + <PropertyRef Name="GUID" /> + </Principal> + <Dependent Role="IDS_PACKS"> + <PropertyRef Name="CONFIGURATION_GUID" /> + </Dependent> + </ReferentialConstraint> + </Association> <Association Name="FK_LIQUIDS_RML_LIQUIDS"> <End Role="LIQUIDS" Type="Self.LIQUIDS" Multiplicity="1" /> <End Role="LIQUIDS_RMLS" Type="Self.LIQUIDS_RMLS" Multiplicity="*" /> @@ -673,27 +686,15 @@ </Dependent> </ReferentialConstraint> </Association> - <Association Name="FK_MACHINE_VERSIONS_CONFIGURATIONS_CONFIGURATIONS"> + <Association Name="FK_MACHINE_VERSIONS_CONFIGURATIONS"> <End Role="CONFIGURATIONS" Type="Self.CONFIGURATIONS" Multiplicity="1" /> - <End Role="MACHINE_VERSIONS_CONFIGURATIONS" Type="Self.MACHINE_VERSIONS_CONFIGURATIONS" Multiplicity="*" /> + <End Role="MACHINE_VERSIONS" Type="Self.MACHINE_VERSIONS" Multiplicity="*" /> <ReferentialConstraint> <Principal Role="CONFIGURATIONS"> <PropertyRef Name="GUID" /> </Principal> - <Dependent Role="MACHINE_VERSIONS_CONFIGURATIONS"> - <PropertyRef Name="CONFIGURATION_GUID" /> - </Dependent> - </ReferentialConstraint> - </Association> - <Association Name="FK_MACHINE_VERSIONS_CONFIGURATIONS_MACHINE_VERSIONS"> - <End Role="MACHINE_VERSIONS" Type="Self.MACHINE_VERSIONS" Multiplicity="1" /> - <End Role="MACHINE_VERSIONS_CONFIGURATIONS" Type="Self.MACHINE_VERSIONS_CONFIGURATIONS" Multiplicity="*" /> - <ReferentialConstraint> - <Principal Role="MACHINE_VERSIONS"> - <PropertyRef Name="GUID" /> - </Principal> - <Dependent Role="MACHINE_VERSIONS_CONFIGURATIONS"> - <PropertyRef Name="MACHINE_VERSION_GUID" /> + <Dependent Role="MACHINE_VERSIONS"> + <PropertyRef Name="DEFAULT_CONFIGURATION_GUID" /> </Dependent> </ReferentialConstraint> </Association> @@ -826,14 +827,14 @@ </ReferentialConstraint> </Association> <Association Name="FK_RML_FIBER_SYNTHESIS"> - <End Role="FIBER_SYNTHESISES" Type="Self.FIBER_SYNTHESISES" Multiplicity="1" /> + <End Role="FIBER_SYNTHS" Type="Self.FIBER_SYNTHS" Multiplicity="1" /> <End Role="RMLS" Type="Self.RMLS" Multiplicity="*" /> <ReferentialConstraint> - <Principal Role="FIBER_SYNTHESISES"> + <Principal Role="FIBER_SYNTHS"> <PropertyRef Name="GUID" /> </Principal> <Dependent Role="RMLS"> - <PropertyRef Name="FIBER_SYNTHESIS_GUID" /> + <PropertyRef Name="FIBER_SYNTH_GUID" /> </Dependent> </ReferentialConstraint> </Association> @@ -1001,14 +1002,13 @@ <EntitySet Name="EVENTS" EntityType="Self.EVENTS" Schema="dbo" store:Type="Tables" /> <EntitySet Name="EVENTS_ACTIONS" EntityType="Self.EVENTS_ACTIONS" Schema="dbo" store:Type="Tables" /> <EntitySet Name="FIBER_SHAPES" EntityType="Self.FIBER_SHAPES" Schema="dbo" store:Type="Tables" /> - <EntitySet Name="FIBER_SYNTHESISES" EntityType="Self.FIBER_SYNTHESISES" Schema="dbo" store:Type="Tables" /> + <EntitySet Name="FIBER_SYNTHS" EntityType="Self.FIBER_SYNTHS" Schema="dbo" store:Type="Tables" /> <EntitySet Name="HARDWARE_VERSIONS" EntityType="Self.HARDWARE_VERSIONS" Schema="dbo" store:Type="Tables" /> <EntitySet Name="IDS_PACKS" EntityType="Self.IDS_PACKS" Schema="dbo" store:Type="Tables" /> <EntitySet Name="LINEAR_MASS_DENSITY_UNITS" EntityType="Self.LINEAR_MASS_DENSITY_UNITS" Schema="dbo" store:Type="Tables" /> <EntitySet Name="LIQUIDS" EntityType="Self.LIQUIDS" Schema="dbo" store:Type="Tables" /> <EntitySet Name="LIQUIDS_RMLS" EntityType="Self.LIQUIDS_RMLS" Schema="dbo" store:Type="Tables" /> <EntitySet Name="MACHINE_VERSIONS" EntityType="Self.MACHINE_VERSIONS" Schema="dbo" store:Type="Tables" /> - <EntitySet Name="MACHINE_VERSIONS_CONFIGURATIONS" EntityType="Self.MACHINE_VERSIONS_CONFIGURATIONS" Schema="dbo" store:Type="Tables" /> <EntitySet Name="MACHINES" EntityType="Self.MACHINES" Schema="dbo" store:Type="Tables" /> <EntitySet Name="MACHINES_CONFIGURATIONS" EntityType="Self.MACHINES_CONFIGURATIONS" Schema="dbo" store:Type="Tables" /> <EntitySet Name="MACHINES_EVENTS" EntityType="Self.MACHINES_EVENTS" Schema="dbo" store:Type="Tables" /> @@ -1048,10 +1048,6 @@ <End Role="CARTRIDGES" EntitySet="CARTRIDGES" /> <End Role="IDS_PACKS" EntitySet="IDS_PACKS" /> </AssociationSet> - <AssociationSet Name="FK_CONFIGURATIONS_DISPENSERS_CONFIGURATIONS" Association="Self.FK_CONFIGURATIONS_DISPENSERS_CONFIGURATIONS"> - <End Role="CONFIGURATIONS" EntitySet="CONFIGURATIONS" /> - <End Role="IDS_PACKS" EntitySet="IDS_PACKS" /> - </AssociationSet> <AssociationSet Name="FK_CONFIGURATIONS_DISPENSERS_DISPENSERS" Association="Self.FK_CONFIGURATIONS_DISPENSERS_DISPENSERS"> <End Role="DISPENSERS" EntitySet="DISPENSERS" /> <End Role="IDS_PACKS" EntitySet="IDS_PACKS" /> @@ -1084,6 +1080,10 @@ <End Role="EVENTS" EntitySet="EVENTS" /> <End Role="EVENTS_ACTIONS" EntitySet="EVENTS_ACTIONS" /> </AssociationSet> + <AssociationSet Name="FK_IDS_PACKS_CONFIGURATIONS" Association="Self.FK_IDS_PACKS_CONFIGURATIONS"> + <End Role="CONFIGURATIONS" EntitySet="CONFIGURATIONS" /> + <End Role="IDS_PACKS" EntitySet="IDS_PACKS" /> + </AssociationSet> <AssociationSet Name="FK_LIQUIDS_RML_LIQUIDS" Association="Self.FK_LIQUIDS_RML_LIQUIDS"> <End Role="LIQUIDS" EntitySet="LIQUIDS" /> <End Role="LIQUIDS_RMLS" EntitySet="LIQUIDS_RMLS" /> @@ -1092,13 +1092,9 @@ <End Role="RMLS" EntitySet="RMLS" /> <End Role="LIQUIDS_RMLS" EntitySet="LIQUIDS_RMLS" /> </AssociationSet> - <AssociationSet Name="FK_MACHINE_VERSIONS_CONFIGURATIONS_CONFIGURATIONS" Association="Self.FK_MACHINE_VERSIONS_CONFIGURATIONS_CONFIGURATIONS"> + <AssociationSet Name="FK_MACHINE_VERSIONS_CONFIGURATIONS" Association="Self.FK_MACHINE_VERSIONS_CONFIGURATIONS"> <End Role="CONFIGURATIONS" EntitySet="CONFIGURATIONS" /> - <End Role="MACHINE_VERSIONS_CONFIGURATIONS" EntitySet="MACHINE_VERSIONS_CONFIGURATIONS" /> - </AssociationSet> - <AssociationSet Name="FK_MACHINE_VERSIONS_CONFIGURATIONS_MACHINE_VERSIONS" Association="Self.FK_MACHINE_VERSIONS_CONFIGURATIONS_MACHINE_VERSIONS"> <End Role="MACHINE_VERSIONS" EntitySet="MACHINE_VERSIONS" /> - <End Role="MACHINE_VERSIONS_CONFIGURATIONS" EntitySet="MACHINE_VERSIONS_CONFIGURATIONS" /> </AssociationSet> <AssociationSet Name="FK_MACHINES_CONFIGURATIONS_CONFIGURATIONS" Association="Self.FK_MACHINES_CONFIGURATIONS_CONFIGURATIONS"> <End Role="CONFIGURATIONS" EntitySet="CONFIGURATIONS" /> @@ -1141,7 +1137,7 @@ <End Role="RMLS" EntitySet="RMLS" /> </AssociationSet> <AssociationSet Name="FK_RML_FIBER_SYNTHESIS" Association="Self.FK_RML_FIBER_SYNTHESIS"> - <End Role="FIBER_SYNTHESISES" EntitySet="FIBER_SYNTHESISES" /> + <End Role="FIBER_SYNTHS" EntitySet="FIBER_SYNTHS" /> <End Role="RMLS" EntitySet="RMLS" /> </AssociationSet> <AssociationSet Name="FK_RML_LINEAR_MASS_DENSITY_UNITS" Association="Self.FK_RML_LINEAR_MASS_DENSITY_UNITS"> @@ -1215,14 +1211,13 @@ <EntitySet Name="EVENTS" EntityType="RemoteModel.EVENT" /> <EntitySet Name="EVENTS_ACTIONS" EntityType="RemoteModel.EVENTS_ACTIONS" /> <EntitySet Name="FIBER_SHAPES" EntityType="RemoteModel.FIBER_SHAPES" /> - <EntitySet Name="FIBER_SYNTHESISES" EntityType="RemoteModel.FIBER_SYNTHESISES" /> + <EntitySet Name="FIBER_SYNTHS" EntityType="RemoteModel.FIBER_SYNTHS" /> <EntitySet Name="HARDWARE_VERSIONS" EntityType="RemoteModel.HARDWARE_VERSIONS" /> <EntitySet Name="IDS_PACKS" EntityType="RemoteModel.IDS_PACKS" /> <EntitySet Name="LINEAR_MASS_DENSITY_UNITS" EntityType="RemoteModel.LINEAR_MASS_DENSITY_UNITS" /> <EntitySet Name="LIQUIDS" EntityType="RemoteModel.LIQUID" /> <EntitySet Name="LIQUIDS_RMLS" EntityType="RemoteModel.LIQUIDS_RMLS" /> <EntitySet Name="MACHINE_VERSIONS" EntityType="RemoteModel.MACHINE_VERSIONS" /> - <EntitySet Name="MACHINE_VERSIONS_CONFIGURATIONS" EntityType="RemoteModel.MACHINE_VERSIONS_CONFIGURATIONS" /> <EntitySet Name="MACHINES" EntityType="RemoteModel.MACHINE" /> <EntitySet Name="MACHINES_CONFIGURATIONS" EntityType="RemoteModel.MACHINES_CONFIGURATIONS" /> <EntitySet Name="MACHINES_EVENTS" EntityType="RemoteModel.MACHINES_EVENTS" /> @@ -1274,10 +1269,6 @@ <End Role="CARTRIDGE" EntitySet="CARTRIDGES" /> <End Role="IDS_PACKS" EntitySet="IDS_PACKS" /> </AssociationSet> - <AssociationSet Name="FK_CONFIGURATIONS_DISPENSERS_CONFIGURATIONS" Association="RemoteModel.FK_CONFIGURATIONS_DISPENSERS_CONFIGURATIONS"> - <End Role="CONFIGURATION" EntitySet="CONFIGURATIONS" /> - <End Role="IDS_PACKS" EntitySet="IDS_PACKS" /> - </AssociationSet> <AssociationSet Name="FK_CONFIGURATIONS_EMBEDDED_FIRMWARE_VERSIONS" Association="RemoteModel.FK_CONFIGURATIONS_EMBEDDED_FIRMWARE_VERSIONS"> <End Role="EMBEDDED_FIRMWARE_VERSIONS" EntitySet="EMBEDDED_FIRMWARE_VERSIONS" /> <End Role="CONFIGURATION" EntitySet="CONFIGURATIONS" /> @@ -1290,9 +1281,13 @@ <End Role="HARDWARE_VERSIONS" EntitySet="HARDWARE_VERSIONS" /> <End Role="CONFIGURATION" EntitySet="CONFIGURATIONS" /> </AssociationSet> - <AssociationSet Name="FK_MACHINE_VERSIONS_CONFIGURATIONS_CONFIGURATIONS" Association="RemoteModel.FK_MACHINE_VERSIONS_CONFIGURATIONS_CONFIGURATIONS"> + <AssociationSet Name="FK_IDS_PACKS_CONFIGURATIONS" Association="RemoteModel.FK_IDS_PACKS_CONFIGURATIONS"> <End Role="CONFIGURATION" EntitySet="CONFIGURATIONS" /> - <End Role="MACHINE_VERSIONS_CONFIGURATIONS" EntitySet="MACHINE_VERSIONS_CONFIGURATIONS" /> + <End Role="IDS_PACKS" EntitySet="IDS_PACKS" /> + </AssociationSet> + <AssociationSet Name="FK_MACHINE_VERSIONS_CONFIGURATIONS" Association="RemoteModel.FK_MACHINE_VERSIONS_CONFIGURATIONS"> + <End Role="CONFIGURATION" EntitySet="CONFIGURATIONS" /> + <End Role="MACHINE_VERSIONS" EntitySet="MACHINE_VERSIONS" /> </AssociationSet> <AssociationSet Name="FK_MACHINES_CONFIGURATIONS_CONFIGURATIONS" Association="RemoteModel.FK_MACHINES_CONFIGURATIONS_CONFIGURATIONS"> <End Role="CONFIGURATION" EntitySet="CONFIGURATIONS" /> @@ -1327,7 +1322,7 @@ <End Role="RML" EntitySet="RMLS" /> </AssociationSet> <AssociationSet Name="FK_RML_FIBER_SYNTHESIS" Association="RemoteModel.FK_RML_FIBER_SYNTHESIS"> - <End Role="FIBER_SYNTHESISES" EntitySet="FIBER_SYNTHESISES" /> + <End Role="FIBER_SYNTHS" EntitySet="FIBER_SYNTHS" /> <End Role="RML" EntitySet="RMLS" /> </AssociationSet> <AssociationSet Name="FK_CONFIGURATIONS_DISPENSERS_LIQUIDS" Association="RemoteModel.FK_CONFIGURATIONS_DISPENSERS_LIQUIDS"> @@ -1346,10 +1341,6 @@ <End Role="RML" EntitySet="RMLS" /> <End Role="LIQUIDS_RMLS" EntitySet="LIQUIDS_RMLS" /> </AssociationSet> - <AssociationSet Name="FK_MACHINE_VERSIONS_CONFIGURATIONS_MACHINE_VERSIONS" Association="RemoteModel.FK_MACHINE_VERSIONS_CONFIGURATIONS_MACHINE_VERSIONS"> - <End Role="MACHINE_VERSIONS" EntitySet="MACHINE_VERSIONS" /> - <End Role="MACHINE_VERSIONS_CONFIGURATIONS" EntitySet="MACHINE_VERSIONS_CONFIGURATIONS" /> - </AssociationSet> <AssociationSet Name="FK_MACHINES_MACHINE_VERSIONS" Association="RemoteModel.FK_MACHINES_MACHINE_VERSIONS"> <End Role="MACHINE_VERSIONS" EntitySet="MACHINE_VERSIONS" /> <End Role="MACHINE" EntitySet="MACHINES" /> @@ -1446,6 +1437,8 @@ <Property Name="GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> <Property Name="LAST_UPDATED" Type="DateTime" Nullable="false" Precision="3" /> <Property Name="DELETED" Type="Boolean" Nullable="false" /> + <Property Name="VERSION" Type="Double" Nullable="false" /> + <Property Name="NAME" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" /> <NavigationProperty Name="CONFIGURATIONS" Relationship="RemoteModel.FK_CONFIGURATIONS_APPLICATION_DISPLAY_PANEL_VERSIONS" FromRole="APPLICATION_DISPLAY_PANEL_VERSIONS" ToRole="CONFIGURATION" /> </EntityType> <EntityType Name="APPLICATION_FIRMWARE_VERSIONS"> @@ -1456,6 +1449,8 @@ <Property Name="GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> <Property Name="LAST_UPDATED" Type="DateTime" Nullable="false" Precision="3" /> <Property Name="DELETED" Type="Boolean" Nullable="false" /> + <Property Name="VERSION" Type="Double" Nullable="false" /> + <Property Name="NAME" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" /> <NavigationProperty Name="CONFIGURATIONS" Relationship="RemoteModel.FK_CONFIGURATIONS_APPLICATION_FIRMWARE_VERSIONS" FromRole="APPLICATION_FIRMWARE_VERSIONS" ToRole="CONFIGURATION" /> </EntityType> <EntityType Name="APPLICATION_OS_VERSIONS"> @@ -1466,6 +1461,8 @@ <Property Name="GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> <Property Name="LAST_UPDATED" Type="DateTime" Nullable="false" Precision="3" /> <Property Name="DELETED" Type="Boolean" Nullable="false" /> + <Property Name="VERSION" Type="Double" Nullable="false" /> + <Property Name="NAME" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" /> <NavigationProperty Name="CONFIGURATIONS" Relationship="RemoteModel.FK_CONFIGURATIONS_APPLICATION_OS_VERSIONS" FromRole="APPLICATION_OS_VERSIONS" ToRole="CONFIGURATION" /> </EntityType> <EntityType Name="APPLICATION_VERSIONS"> @@ -1476,6 +1473,8 @@ <Property Name="GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> <Property Name="LAST_UPDATED" Type="DateTime" Nullable="false" Precision="3" /> <Property Name="DELETED" Type="Boolean" Nullable="false" /> + <Property Name="VERSION" Type="Double" Nullable="false" /> + <Property Name="NAME" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" /> <NavigationProperty Name="CONFIGURATIONS" Relationship="RemoteModel.FK_CONFIGURATIONS_APPLICATION_VERSIONS" FromRole="APPLICATION_VERSIONS" ToRole="CONFIGURATION" /> </EntityType> <EntityType Name="CARTRIDGE_TYPES"> @@ -1486,6 +1485,8 @@ <Property Name="GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> <Property Name="LAST_UPDATED" Type="DateTime" Nullable="false" Precision="3" /> <Property Name="DELETED" Type="Boolean" Nullable="false" /> + <Property Name="CODE" Type="Int32" Nullable="false" /> + <Property Name="NAME" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" /> <NavigationProperty Name="CARTRIDGES" Relationship="RemoteModel.FK_CARTRIDGES_CARTRIDGE_TYPES" FromRole="CARTRIDGE_TYPES" ToRole="CARTRIDGE" /> </EntityType> <EntityType Name="CARTRIDGE"> @@ -1496,6 +1497,7 @@ <Property Name="GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> <Property Name="LAST_UPDATED" Type="DateTime" Nullable="false" Precision="3" /> <Property Name="DELETED" Type="Boolean" Nullable="false" /> + <Property Name="SERIAL_NUMBER" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" /> <Property Name="CARTRIDGE_TYPE_GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> <NavigationProperty Name="CARTRIDGE_TYPES" Relationship="RemoteModel.FK_CARTRIDGES_CARTRIDGE_TYPES" FromRole="CARTRIDGE" ToRole="CARTRIDGE_TYPES" /> <NavigationProperty Name="IDS_PACKS" Relationship="RemoteModel.FK_CONFIGURATIONS_DISPENSERS_CARTRIDGES" FromRole="CARTRIDGE" ToRole="IDS_PACKS" /> @@ -1521,11 +1523,11 @@ <NavigationProperty Name="APPLICATION_FIRMWARE_VERSIONS" Relationship="RemoteModel.FK_CONFIGURATIONS_APPLICATION_FIRMWARE_VERSIONS" FromRole="CONFIGURATION" ToRole="APPLICATION_FIRMWARE_VERSIONS" /> <NavigationProperty Name="APPLICATION_OS_VERSIONS" Relationship="RemoteModel.FK_CONFIGURATIONS_APPLICATION_OS_VERSIONS" FromRole="CONFIGURATION" ToRole="APPLICATION_OS_VERSIONS" /> <NavigationProperty Name="APPLICATION_VERSIONS" Relationship="RemoteModel.FK_CONFIGURATIONS_APPLICATION_VERSIONS" FromRole="CONFIGURATION" ToRole="APPLICATION_VERSIONS" /> - <NavigationProperty Name="IDS_PACKS" Relationship="RemoteModel.FK_CONFIGURATIONS_DISPENSERS_CONFIGURATIONS" FromRole="CONFIGURATION" ToRole="IDS_PACKS" /> <NavigationProperty Name="EMBEDDED_FIRMWARE_VERSIONS" Relationship="RemoteModel.FK_CONFIGURATIONS_EMBEDDED_FIRMWARE_VERSIONS" FromRole="CONFIGURATION" ToRole="EMBEDDED_FIRMWARE_VERSIONS" /> <NavigationProperty Name="EMBEDDED_SOFTWARE_VERSIONS" Relationship="RemoteModel.FK_CONFIGURATIONS_EMBEDDED_SOFTWARE_VERSIONS" FromRole="CONFIGURATION" ToRole="EMBEDDED_SOFTWARE_VERSIONS" /> <NavigationProperty Name="HARDWARE_VERSIONS" Relationship="RemoteModel.FK_CONFIGURATIONS_HARDWARE_VERSIONS" FromRole="CONFIGURATION" ToRole="HARDWARE_VERSIONS" /> - <NavigationProperty Name="MACHINE_VERSIONS_CONFIGURATIONS" Relationship="RemoteModel.FK_MACHINE_VERSIONS_CONFIGURATIONS_CONFIGURATIONS" FromRole="CONFIGURATION" ToRole="MACHINE_VERSIONS_CONFIGURATIONS" /> + <NavigationProperty Name="IDS_PACKS" Relationship="RemoteModel.FK_IDS_PACKS_CONFIGURATIONS" FromRole="CONFIGURATION" ToRole="IDS_PACKS" /> + <NavigationProperty Name="MACHINE_VERSIONS" Relationship="RemoteModel.FK_MACHINE_VERSIONS_CONFIGURATIONS" FromRole="CONFIGURATION" ToRole="MACHINE_VERSIONS" /> <NavigationProperty Name="MACHINES_CONFIGURATIONS" Relationship="RemoteModel.FK_MACHINES_CONFIGURATIONS_CONFIGURATIONS" FromRole="CONFIGURATION" ToRole="MACHINES_CONFIGURATIONS" /> </EntityType> <EntityType Name="CONTACT"> @@ -1553,6 +1555,8 @@ <Property Name="GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> <Property Name="LAST_UPDATED" Type="DateTime" Nullable="false" Precision="3" /> <Property Name="DELETED" Type="Boolean" Nullable="false" /> + <Property Name="CODE" Type="Int32" Nullable="false" /> + <Property Name="NAME" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" /> <NavigationProperty Name="DISPENSERS" Relationship="RemoteModel.FK_DISPENSERS_DISPENSER_TYPES" FromRole="DISPENSER_TYPES" ToRole="DISPENSER" /> </EntityType> <EntityType Name="DISPENSER"> @@ -1563,6 +1567,7 @@ <Property Name="GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> <Property Name="LAST_UPDATED" Type="DateTime" Nullable="false" Precision="3" /> <Property Name="DELETED" Type="Boolean" Nullable="false" /> + <Property Name="SERIAL_NUMBER" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" /> <Property Name="DISPENSER_TYPE_GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> <NavigationProperty Name="DISPENSER_TYPES" Relationship="RemoteModel.FK_DISPENSERS_DISPENSER_TYPES" FromRole="DISPENSER" ToRole="DISPENSER_TYPES" /> <NavigationProperty Name="IDS_PACKS" Relationship="RemoteModel.FK_CONFIGURATIONS_DISPENSERS_DISPENSERS" FromRole="DISPENSER" ToRole="IDS_PACKS" /> @@ -1575,6 +1580,8 @@ <Property Name="GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> <Property Name="LAST_UPDATED" Type="DateTime" Nullable="false" Precision="3" /> <Property Name="DELETED" Type="Boolean" Nullable="false" /> + <Property Name="VERSION" Type="Double" Nullable="false" /> + <Property Name="NAME" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" /> <NavigationProperty Name="CONFIGURATIONS" Relationship="RemoteModel.FK_CONFIGURATIONS_EMBEDDED_FIRMWARE_VERSIONS" FromRole="EMBEDDED_FIRMWARE_VERSIONS" ToRole="CONFIGURATION" /> </EntityType> <EntityType Name="EMBEDDED_SOFTWARE_VERSIONS"> @@ -1585,6 +1592,8 @@ <Property Name="GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> <Property Name="LAST_UPDATED" Type="DateTime" Nullable="false" Precision="3" /> <Property Name="DELETED" Type="Boolean" Nullable="false" /> + <Property Name="VERSION" Type="Double" Nullable="false" /> + <Property Name="NAME" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" /> <NavigationProperty Name="CONFIGURATIONS" Relationship="RemoteModel.FK_CONFIGURATIONS_EMBEDDED_SOFTWARE_VERSIONS" FromRole="EMBEDDED_SOFTWARE_VERSIONS" ToRole="CONFIGURATION" /> </EntityType> <EntityType Name="EVENT"> @@ -1626,7 +1635,7 @@ <Property Name="CODE" Type="Int32" Nullable="false" /> <NavigationProperty Name="RMLS" Relationship="RemoteModel.FK_RML_FIBER_SHAPES" FromRole="FIBER_SHAPES" ToRole="RML" /> </EntityType> - <EntityType Name="FIBER_SYNTHESISES"> + <EntityType Name="FIBER_SYNTHS"> <Key> <PropertyRef Name="GUID" /> </Key> @@ -1636,7 +1645,7 @@ <Property Name="DELETED" Type="Boolean" Nullable="false" /> <Property Name="NAME" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" /> <Property Name="CODE" Type="Int32" Nullable="false" /> - <NavigationProperty Name="RMLS" Relationship="RemoteModel.FK_RML_FIBER_SYNTHESIS" FromRole="FIBER_SYNTHESISES" ToRole="RML" /> + <NavigationProperty Name="RMLS" Relationship="RemoteModel.FK_RML_FIBER_SYNTHESIS" FromRole="FIBER_SYNTHS" ToRole="RML" /> </EntityType> <EntityType Name="HARDWARE_VERSIONS"> <Key> @@ -1646,6 +1655,8 @@ <Property Name="GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> <Property Name="LAST_UPDATED" Type="DateTime" Nullable="false" Precision="3" /> <Property Name="DELETED" Type="Boolean" Nullable="false" /> + <Property Name="VERSION" Type="Double" Nullable="false" /> + <Property Name="NAME" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" /> <NavigationProperty Name="CONFIGURATIONS" Relationship="RemoteModel.FK_CONFIGURATIONS_HARDWARE_VERSIONS" FromRole="HARDWARE_VERSIONS" ToRole="CONFIGURATION" /> </EntityType> <EntityType Name="IDS_PACKS"> @@ -1660,8 +1671,9 @@ <Property Name="DISPENSER_GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> <Property Name="LIQUID_GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> <Property Name="CARTRIDGE_GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> + <Property Name="NAME" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" /> <NavigationProperty Name="CARTRIDGE" Relationship="RemoteModel.FK_CONFIGURATIONS_DISPENSERS_CARTRIDGES" FromRole="IDS_PACKS" ToRole="CARTRIDGE" /> - <NavigationProperty Name="CONFIGURATION" Relationship="RemoteModel.FK_CONFIGURATIONS_DISPENSERS_CONFIGURATIONS" FromRole="IDS_PACKS" ToRole="CONFIGURATION" /> + <NavigationProperty Name="CONFIGURATION" Relationship="RemoteModel.FK_IDS_PACKS_CONFIGURATIONS" FromRole="IDS_PACKS" ToRole="CONFIGURATION" /> <NavigationProperty Name="DISPENSER" Relationship="RemoteModel.FK_CONFIGURATIONS_DISPENSERS_DISPENSERS" FromRole="IDS_PACKS" ToRole="DISPENSER" /> <NavigationProperty Name="LIQUID" Relationship="RemoteModel.FK_CONFIGURATIONS_DISPENSERS_LIQUIDS" FromRole="IDS_PACKS" ToRole="LIQUID" /> </EntityType> @@ -1688,6 +1700,7 @@ <Property Name="CODE" Type="Int32" Nullable="false" /> <Property Name="NAME" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" /> <Property Name="VERSION" Type="Double" Nullable="false" /> + <Property Name="COLOR" Type="Int32" Nullable="false" /> <NavigationProperty Name="IDS_PACKS" Relationship="RemoteModel.FK_CONFIGURATIONS_DISPENSERS_LIQUIDS" FromRole="LIQUID" ToRole="IDS_PACKS" /> <NavigationProperty Name="LIQUIDS_RMLS" Relationship="RemoteModel.FK_LIQUIDS_RML_LIQUIDS" FromRole="LIQUID" ToRole="LIQUIDS_RMLS" /> </EntityType> @@ -1713,22 +1726,11 @@ <Property Name="LAST_UPDATED" Type="DateTime" Nullable="false" Precision="3" /> <Property Name="DELETED" Type="Boolean" Nullable="false" /> <Property Name="VERSION" Type="Double" Nullable="false" /> - <NavigationProperty Name="MACHINE_VERSIONS_CONFIGURATIONS" Relationship="RemoteModel.FK_MACHINE_VERSIONS_CONFIGURATIONS_MACHINE_VERSIONS" FromRole="MACHINE_VERSIONS" ToRole="MACHINE_VERSIONS_CONFIGURATIONS" /> + <Property Name="NAME" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" /> + <Property Name="DEFAULT_CONFIGURATION_GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> + <NavigationProperty Name="CONFIGURATION" Relationship="RemoteModel.FK_MACHINE_VERSIONS_CONFIGURATIONS" FromRole="MACHINE_VERSIONS" ToRole="CONFIGURATION" /> <NavigationProperty Name="MACHINES" Relationship="RemoteModel.FK_MACHINES_MACHINE_VERSIONS" FromRole="MACHINE_VERSIONS" ToRole="MACHINE" /> </EntityType> - <EntityType Name="MACHINE_VERSIONS_CONFIGURATIONS"> - <Key> - <PropertyRef Name="GUID" /> - </Key> - <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" /> - <Property Name="GUID" Type="Guid" Nullable="false" /> - <Property Name="LAST_UPDATED" Type="DateTime" Nullable="false" Precision="3" /> - <Property Name="DELETED" Type="Boolean" Nullable="false" /> - <Property Name="MACHINE_VERSION_GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> - <Property Name="CONFIGURATION_GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> - <NavigationProperty Name="CONFIGURATION" Relationship="RemoteModel.FK_MACHINE_VERSIONS_CONFIGURATIONS_CONFIGURATIONS" FromRole="MACHINE_VERSIONS_CONFIGURATIONS" ToRole="CONFIGURATION" /> - <NavigationProperty Name="MACHINE_VERSIONS" Relationship="RemoteModel.FK_MACHINE_VERSIONS_CONFIGURATIONS_MACHINE_VERSIONS" FromRole="MACHINE_VERSIONS_CONFIGURATIONS" ToRole="MACHINE_VERSIONS" /> - </EntityType> <EntityType Name="MACHINE"> <Key> <PropertyRef Name="GUID" /> @@ -1868,7 +1870,7 @@ <Property Name="CONDITION_GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> <Property Name="LINEAR_MASS_DENSITY_UNIT_GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> <Property Name="FIBER_SHAPE_GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> - <Property Name="FIBER_SYNTHESIS_GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> + <Property Name="FIBER_SYNTH_GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> <Property Name="FIBER_SIZE" Type="Double" Nullable="false" /> <Property Name="NUMBER_OF_FIBERS" Type="Int32" Nullable="false" /> <Property Name="PLIES_PER_FIBER" Type="Int32" Nullable="false" /> @@ -1880,7 +1882,7 @@ <Property Name="ELONGATION_AT_BREAK_PERCENTAGE" Type="Double" Nullable="false" /> <Property Name="ESTIMATED_THREAD_DIAMETER" Type="Double" Nullable="false" /> <NavigationProperty Name="FIBER_SHAPES" Relationship="RemoteModel.FK_RML_FIBER_SHAPES" FromRole="RML" ToRole="FIBER_SHAPES" /> - <NavigationProperty Name="FIBER_SYNTHESISES" Relationship="RemoteModel.FK_RML_FIBER_SYNTHESIS" FromRole="RML" ToRole="FIBER_SYNTHESISES" /> + <NavigationProperty Name="FIBER_SYNTHS" Relationship="RemoteModel.FK_RML_FIBER_SYNTHESIS" FromRole="RML" ToRole="FIBER_SYNTHS" /> <NavigationProperty Name="LINEAR_MASS_DENSITY_UNITS" Relationship="RemoteModel.FK_RML_LINEAR_MASS_DENSITY_UNITS" FromRole="RML" ToRole="LINEAR_MASS_DENSITY_UNITS" /> <NavigationProperty Name="LIQUIDS_RMLS" Relationship="RemoteModel.FK_LIQUIDS_RML_RML" FromRole="RML" ToRole="LIQUIDS_RMLS" /> <NavigationProperty Name="MEDIA_COLORS" Relationship="RemoteModel.FK_RML_MEDIA_COLORS" FromRole="RML" ToRole="MEDIA_COLORS" /> @@ -2065,18 +2067,6 @@ </Dependent> </ReferentialConstraint> </Association> - <Association Name="FK_CONFIGURATIONS_DISPENSERS_CONFIGURATIONS"> - <End Type="RemoteModel.CONFIGURATION" Role="CONFIGURATION" Multiplicity="1" /> - <End Type="RemoteModel.IDS_PACKS" Role="IDS_PACKS" Multiplicity="*" /> - <ReferentialConstraint> - <Principal Role="CONFIGURATION"> - <PropertyRef Name="GUID" /> - </Principal> - <Dependent Role="IDS_PACKS"> - <PropertyRef Name="DISPENSER_GUID" /> - </Dependent> - </ReferentialConstraint> - </Association> <Association Name="FK_CONFIGURATIONS_EMBEDDED_FIRMWARE_VERSIONS"> <End Type="RemoteModel.EMBEDDED_FIRMWARE_VERSIONS" Role="EMBEDDED_FIRMWARE_VERSIONS" Multiplicity="1" /> <End Type="RemoteModel.CONFIGURATION" Role="CONFIGURATION" Multiplicity="*" /> @@ -2113,18 +2103,30 @@ </Dependent> </ReferentialConstraint> </Association> - <Association Name="FK_MACHINE_VERSIONS_CONFIGURATIONS_CONFIGURATIONS"> + <Association Name="FK_IDS_PACKS_CONFIGURATIONS"> <End Type="RemoteModel.CONFIGURATION" Role="CONFIGURATION" Multiplicity="1" /> - <End Type="RemoteModel.MACHINE_VERSIONS_CONFIGURATIONS" Role="MACHINE_VERSIONS_CONFIGURATIONS" Multiplicity="*" /> + <End Type="RemoteModel.IDS_PACKS" Role="IDS_PACKS" Multiplicity="*" /> <ReferentialConstraint> <Principal Role="CONFIGURATION"> <PropertyRef Name="GUID" /> </Principal> - <Dependent Role="MACHINE_VERSIONS_CONFIGURATIONS"> + <Dependent Role="IDS_PACKS"> <PropertyRef Name="CONFIGURATION_GUID" /> </Dependent> </ReferentialConstraint> </Association> + <Association Name="FK_MACHINE_VERSIONS_CONFIGURATIONS"> + <End Type="RemoteModel.CONFIGURATION" Role="CONFIGURATION" Multiplicity="1" /> + <End Type="RemoteModel.MACHINE_VERSIONS" Role="MACHINE_VERSIONS" Multiplicity="*" /> + <ReferentialConstraint> + <Principal Role="CONFIGURATION"> + <PropertyRef Name="GUID" /> + </Principal> + <Dependent Role="MACHINE_VERSIONS"> + <PropertyRef Name="DEFAULT_CONFIGURATION_GUID" /> + </Dependent> + </ReferentialConstraint> + </Association> <Association Name="FK_MACHINES_CONFIGURATIONS_CONFIGURATIONS"> <End Type="RemoteModel.CONFIGURATION" Role="CONFIGURATION" Multiplicity="1" /> <End Type="RemoteModel.MACHINES_CONFIGURATIONS" Role="MACHINES_CONFIGURATIONS" Multiplicity="*" /> @@ -2224,14 +2226,14 @@ </ReferentialConstraint> </Association> <Association Name="FK_RML_FIBER_SYNTHESIS"> - <End Type="RemoteModel.FIBER_SYNTHESISES" Role="FIBER_SYNTHESISES" Multiplicity="1" /> + <End Type="RemoteModel.FIBER_SYNTHS" Role="FIBER_SYNTHS" Multiplicity="1" /> <End Type="RemoteModel.RML" Role="RML" Multiplicity="*" /> <ReferentialConstraint> - <Principal Role="FIBER_SYNTHESISES"> + <Principal Role="FIBER_SYNTHS"> <PropertyRef Name="GUID" /> </Principal> <Dependent Role="RML"> - <PropertyRef Name="FIBER_SYNTHESIS_GUID" /> + <PropertyRef Name="FIBER_SYNTH_GUID" /> </Dependent> </ReferentialConstraint> </Association> @@ -2283,18 +2285,6 @@ </Dependent> </ReferentialConstraint> </Association> - <Association Name="FK_MACHINE_VERSIONS_CONFIGURATIONS_MACHINE_VERSIONS"> - <End Type="RemoteModel.MACHINE_VERSIONS" Role="MACHINE_VERSIONS" Multiplicity="1" /> - <End Type="RemoteModel.MACHINE_VERSIONS_CONFIGURATIONS" Role="MACHINE_VERSIONS_CONFIGURATIONS" Multiplicity="*" /> - <ReferentialConstraint> - <Principal Role="MACHINE_VERSIONS"> - <PropertyRef Name="GUID" /> - </Principal> - <Dependent Role="MACHINE_VERSIONS_CONFIGURATIONS"> - <PropertyRef Name="MACHINE_VERSION_GUID" /> - </Dependent> - </ReferentialConstraint> - </Association> <Association Name="FK_MACHINES_MACHINE_VERSIONS"> <End Type="RemoteModel.MACHINE_VERSIONS" Role="MACHINE_VERSIONS" Multiplicity="1" /> <End Type="RemoteModel.MACHINE" Role="MACHINE" Multiplicity="*" /> @@ -2508,6 +2498,8 @@ <EntitySetMapping Name="APPLICATION_DISPLAY_PANEL_VERSIONS"> <EntityTypeMapping TypeName="RemoteModel.APPLICATION_DISPLAY_PANEL_VERSIONS"> <MappingFragment StoreEntitySet="APPLICATION_DISPLAY_PANEL_VERSIONS"> + <ScalarProperty Name="NAME" ColumnName="NAME" /> + <ScalarProperty Name="VERSION" ColumnName="VERSION" /> <ScalarProperty Name="DELETED" ColumnName="DELETED" /> <ScalarProperty Name="LAST_UPDATED" ColumnName="LAST_UPDATED" /> <ScalarProperty Name="GUID" ColumnName="GUID" /> @@ -2518,6 +2510,8 @@ <EntitySetMapping Name="APPLICATION_FIRMWARE_VERSIONS"> <EntityTypeMapping TypeName="RemoteModel.APPLICATION_FIRMWARE_VERSIONS"> <MappingFragment StoreEntitySet="APPLICATION_FIRMWARE_VERSIONS"> + <ScalarProperty Name="NAME" ColumnName="NAME" /> + <ScalarProperty Name="VERSION" ColumnName="VERSION" /> <ScalarProperty Name="DELETED" ColumnName="DELETED" /> <ScalarProperty Name="LAST_UPDATED" ColumnName="LAST_UPDATED" /> <ScalarProperty Name="GUID" ColumnName="GUID" /> @@ -2528,6 +2522,8 @@ <EntitySetMapping Name="APPLICATION_OS_VERSIONS"> <EntityTypeMapping TypeName="RemoteModel.APPLICATION_OS_VERSIONS"> <MappingFragment StoreEntitySet="APPLICATION_OS_VERSIONS"> + <ScalarProperty Name="NAME" ColumnName="NAME" /> + <ScalarProperty Name="VERSION" ColumnName="VERSION" /> <ScalarProperty Name="DELETED" ColumnName="DELETED" /> <ScalarProperty Name="LAST_UPDATED" ColumnName="LAST_UPDATED" /> <ScalarProperty Name="GUID" ColumnName="GUID" /> @@ -2538,6 +2534,8 @@ <EntitySetMapping Name="APPLICATION_VERSIONS"> <EntityTypeMapping TypeName="RemoteModel.APPLICATION_VERSIONS"> <MappingFragment StoreEntitySet="APPLICATION_VERSIONS"> + <ScalarProperty Name="NAME" ColumnName="NAME" /> + <ScalarProperty Name="VERSION" ColumnName="VERSION" /> <ScalarProperty Name="DELETED" ColumnName="DELETED" /> <ScalarProperty Name="LAST_UPDATED" ColumnName="LAST_UPDATED" /> <ScalarProperty Name="GUID" ColumnName="GUID" /> @@ -2548,6 +2546,8 @@ <EntitySetMapping Name="CARTRIDGE_TYPES"> <EntityTypeMapping TypeName="RemoteModel.CARTRIDGE_TYPES"> <MappingFragment StoreEntitySet="CARTRIDGE_TYPES"> + <ScalarProperty Name="NAME" ColumnName="NAME" /> + <ScalarProperty Name="CODE" ColumnName="CODE" /> <ScalarProperty Name="DELETED" ColumnName="DELETED" /> <ScalarProperty Name="LAST_UPDATED" ColumnName="LAST_UPDATED" /> <ScalarProperty Name="GUID" ColumnName="GUID" /> @@ -2559,6 +2559,7 @@ <EntityTypeMapping TypeName="RemoteModel.CARTRIDGE"> <MappingFragment StoreEntitySet="CARTRIDGES"> <ScalarProperty Name="CARTRIDGE_TYPE_GUID" ColumnName="CARTRIDGE_TYPE_GUID" /> + <ScalarProperty Name="SERIAL_NUMBER" ColumnName="SERIAL_NUMBER" /> <ScalarProperty Name="DELETED" ColumnName="DELETED" /> <ScalarProperty Name="LAST_UPDATED" ColumnName="LAST_UPDATED" /> <ScalarProperty Name="GUID" ColumnName="GUID" /> @@ -2604,6 +2605,8 @@ <EntitySetMapping Name="DISPENSER_TYPES"> <EntityTypeMapping TypeName="RemoteModel.DISPENSER_TYPES"> <MappingFragment StoreEntitySet="DISPENSER_TYPES"> + <ScalarProperty Name="NAME" ColumnName="NAME" /> + <ScalarProperty Name="CODE" ColumnName="CODE" /> <ScalarProperty Name="DELETED" ColumnName="DELETED" /> <ScalarProperty Name="LAST_UPDATED" ColumnName="LAST_UPDATED" /> <ScalarProperty Name="GUID" ColumnName="GUID" /> @@ -2615,6 +2618,7 @@ <EntityTypeMapping TypeName="RemoteModel.DISPENSER"> <MappingFragment StoreEntitySet="DISPENSERS"> <ScalarProperty Name="DISPENSER_TYPE_GUID" ColumnName="DISPENSER_TYPE_GUID" /> + <ScalarProperty Name="SERIAL_NUMBER" ColumnName="SERIAL_NUMBER" /> <ScalarProperty Name="DELETED" ColumnName="DELETED" /> <ScalarProperty Name="LAST_UPDATED" ColumnName="LAST_UPDATED" /> <ScalarProperty Name="GUID" ColumnName="GUID" /> @@ -2625,6 +2629,8 @@ <EntitySetMapping Name="EMBEDDED_FIRMWARE_VERSIONS"> <EntityTypeMapping TypeName="RemoteModel.EMBEDDED_FIRMWARE_VERSIONS"> <MappingFragment StoreEntitySet="EMBEDDED_FIRMWARE_VERSIONS"> + <ScalarProperty Name="NAME" ColumnName="NAME" /> + <ScalarProperty Name="VERSION" ColumnName="VERSION" /> <ScalarProperty Name="DELETED" ColumnName="DELETED" /> <ScalarProperty Name="LAST_UPDATED" ColumnName="LAST_UPDATED" /> <ScalarProperty Name="GUID" ColumnName="GUID" /> @@ -2635,6 +2641,8 @@ <EntitySetMapping Name="EMBEDDED_SOFTWARE_VERSIONS"> <EntityTypeMapping TypeName="RemoteModel.EMBEDDED_SOFTWARE_VERSIONS"> <MappingFragment StoreEntitySet="EMBEDDED_SOFTWARE_VERSIONS"> + <ScalarProperty Name="NAME" ColumnName="NAME" /> + <ScalarProperty Name="VERSION" ColumnName="VERSION" /> <ScalarProperty Name="DELETED" ColumnName="DELETED" /> <ScalarProperty Name="LAST_UPDATED" ColumnName="LAST_UPDATED" /> <ScalarProperty Name="GUID" ColumnName="GUID" /> @@ -2679,9 +2687,9 @@ </MappingFragment> </EntityTypeMapping> </EntitySetMapping> - <EntitySetMapping Name="FIBER_SYNTHESISES"> - <EntityTypeMapping TypeName="RemoteModel.FIBER_SYNTHESISES"> - <MappingFragment StoreEntitySet="FIBER_SYNTHESISES"> + <EntitySetMapping Name="FIBER_SYNTHS"> + <EntityTypeMapping TypeName="RemoteModel.FIBER_SYNTHS"> + <MappingFragment StoreEntitySet="FIBER_SYNTHS"> <ScalarProperty Name="CODE" ColumnName="CODE" /> <ScalarProperty Name="NAME" ColumnName="NAME" /> <ScalarProperty Name="DELETED" ColumnName="DELETED" /> @@ -2694,6 +2702,8 @@ <EntitySetMapping Name="HARDWARE_VERSIONS"> <EntityTypeMapping TypeName="RemoteModel.HARDWARE_VERSIONS"> <MappingFragment StoreEntitySet="HARDWARE_VERSIONS"> + <ScalarProperty Name="NAME" ColumnName="NAME" /> + <ScalarProperty Name="VERSION" ColumnName="VERSION" /> <ScalarProperty Name="DELETED" ColumnName="DELETED" /> <ScalarProperty Name="LAST_UPDATED" ColumnName="LAST_UPDATED" /> <ScalarProperty Name="GUID" ColumnName="GUID" /> @@ -2704,6 +2714,7 @@ <EntitySetMapping Name="IDS_PACKS"> <EntityTypeMapping TypeName="RemoteModel.IDS_PACKS"> <MappingFragment StoreEntitySet="IDS_PACKS"> + <ScalarProperty Name="NAME" ColumnName="NAME" /> <ScalarProperty Name="CARTRIDGE_GUID" ColumnName="CARTRIDGE_GUID" /> <ScalarProperty Name="LIQUID_GUID" ColumnName="LIQUID_GUID" /> <ScalarProperty Name="DISPENSER_GUID" ColumnName="DISPENSER_GUID" /> @@ -2730,6 +2741,7 @@ <EntitySetMapping Name="LIQUIDS"> <EntityTypeMapping TypeName="RemoteModel.LIQUID"> <MappingFragment StoreEntitySet="LIQUIDS"> + <ScalarProperty Name="COLOR" ColumnName="COLOR" /> <ScalarProperty Name="VERSION" ColumnName="VERSION" /> <ScalarProperty Name="NAME" ColumnName="NAME" /> <ScalarProperty Name="CODE" ColumnName="CODE" /> @@ -2755,6 +2767,8 @@ <EntitySetMapping Name="MACHINE_VERSIONS"> <EntityTypeMapping TypeName="RemoteModel.MACHINE_VERSIONS"> <MappingFragment StoreEntitySet="MACHINE_VERSIONS"> + <ScalarProperty Name="DEFAULT_CONFIGURATION_GUID" ColumnName="DEFAULT_CONFIGURATION_GUID" /> + <ScalarProperty Name="NAME" ColumnName="NAME" /> <ScalarProperty Name="VERSION" ColumnName="VERSION" /> <ScalarProperty Name="DELETED" ColumnName="DELETED" /> <ScalarProperty Name="LAST_UPDATED" ColumnName="LAST_UPDATED" /> @@ -2763,18 +2777,6 @@ </MappingFragment> </EntityTypeMapping> </EntitySetMapping> - <EntitySetMapping Name="MACHINE_VERSIONS_CONFIGURATIONS"> - <EntityTypeMapping TypeName="RemoteModel.MACHINE_VERSIONS_CONFIGURATIONS"> - <MappingFragment StoreEntitySet="MACHINE_VERSIONS_CONFIGURATIONS"> - <ScalarProperty Name="CONFIGURATION_GUID" ColumnName="CONFIGURATION_GUID" /> - <ScalarProperty Name="MACHINE_VERSION_GUID" ColumnName="MACHINE_VERSION_GUID" /> - <ScalarProperty Name="DELETED" ColumnName="DELETED" /> - <ScalarProperty Name="LAST_UPDATED" ColumnName="LAST_UPDATED" /> - <ScalarProperty Name="GUID" ColumnName="GUID" /> - <ScalarProperty Name="ID" ColumnName="ID" /> - </MappingFragment> - </EntityTypeMapping> - </EntitySetMapping> <EntitySetMapping Name="MACHINES"> <EntityTypeMapping TypeName="RemoteModel.MACHINE"> <MappingFragment StoreEntitySet="MACHINES"> @@ -2903,7 +2905,7 @@ <ScalarProperty Name="PLIES_PER_FIBER" ColumnName="PLIES_PER_FIBER" /> <ScalarProperty Name="NUMBER_OF_FIBERS" ColumnName="NUMBER_OF_FIBERS" /> <ScalarProperty Name="FIBER_SIZE" ColumnName="FIBER_SIZE" /> - <ScalarProperty Name="FIBER_SYNTHESIS_GUID" ColumnName="FIBER_SYNTHESIS_GUID" /> + <ScalarProperty Name="FIBER_SYNTH_GUID" ColumnName="FIBER_SYNTH_GUID" /> <ScalarProperty Name="FIBER_SHAPE_GUID" ColumnName="FIBER_SHAPE_GUID" /> <ScalarProperty Name="LINEAR_MASS_DENSITY_UNIT_GUID" ColumnName="LINEAR_MASS_DENSITY_UNIT_GUID" /> <ScalarProperty Name="CONDITION_GUID" ColumnName="CONDITION_GUID" /> diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram index 77ddcf4bd..a01b4fd94 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,46 +5,45 @@ <!-- Diagram content (shape and connector positions) --> <edmx:Diagrams> <Diagram DiagramId="f9ae01d708754bbd997add25a4bacc79" Name="Diagram1"> - <EntityTypeShape EntityType="RemoteModel.ACTION" Width="1.5" PointX="9" PointY="36.625" /> - <EntityTypeShape EntityType="RemoteModel.ADDRESS" Width="1.5" PointX="1.5" PointY="36.625" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_DISPLAY_PANEL_VERSIONS" Width="1.5" PointX="0.75" PointY="6.25" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_FIRMWARE_VERSIONS" Width="1.5" PointX="0.75" PointY="15.375" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_OS_VERSIONS" Width="1.5" PointX="0.75" PointY="18.125" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_VERSIONS" Width="1.5" PointX="0.75" PointY="20.875" /> - <EntityTypeShape EntityType="RemoteModel.CARTRIDGE_TYPES" Width="1.5" PointX="0.75" PointY="45.5" /> - <EntityTypeShape EntityType="RemoteModel.CARTRIDGE" Width="1.5" PointX="3" PointY="45.375" /> - <EntityTypeShape EntityType="RemoteModel.CONFIGURATION" Width="1.5" PointX="3" PointY="4.5" /> - <EntityTypeShape EntityType="RemoteModel.CONTACT" Width="1.5" PointX="1.5" PointY="40.875" /> - <EntityTypeShape EntityType="RemoteModel.DISPENSER_TYPES" Width="1.5" PointX="0.75" PointY="2.625" /> - <EntityTypeShape EntityType="RemoteModel.DISPENSER" Width="1.5" PointX="3" PointY="0.75" /> - <EntityTypeShape EntityType="RemoteModel.EMBEDDED_FIRMWARE_VERSIONS" Width="1.5" PointX="0.75" PointY="12.75" /> - <EntityTypeShape EntityType="RemoteModel.EMBEDDED_SOFTWARE_VERSIONS" Width="1.5" PointX="0.75" PointY="10" /> - <EntityTypeShape EntityType="RemoteModel.EVENT" Width="1.5" PointX="6" PointY="40.5" /> - <EntityTypeShape EntityType="RemoteModel.EVENTS_ACTIONS" Width="1.5" PointX="11.25" PointY="40.625" /> - <EntityTypeShape EntityType="RemoteModel.FIBER_SHAPES" Width="1.5" PointX="5.75" PointY="15.625" /> - <EntityTypeShape EntityType="RemoteModel.FIBER_SYNTHESISES" Width="1.5" PointX="5.75" PointY="21.875" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_VERSIONS" Width="1.5" PointX="0.75" PointY="23.625" /> - <EntityTypeShape EntityType="RemoteModel.IDS_PACKS" Width="1.5" PointX="5.25" PointY="5.625" /> - <EntityTypeShape EntityType="RemoteModel.LINEAR_MASS_DENSITY_UNITS" Width="1.5" PointX="5.75" PointY="12.375" /> - <EntityTypeShape EntityType="RemoteModel.LIQUID" Width="1.5" PointX="3" PointY="10.875" /> - <EntityTypeShape EntityType="RemoteModel.LIQUIDS_RMLS" Width="1.5" PointX="10.25" PointY="12.25" /> - <EntityTypeShape EntityType="RemoteModel.MACHINE_VERSIONS" Width="1.5" PointX="0.75" PointY="26.5" /> - <EntityTypeShape EntityType="RemoteModel.MACHINE_VERSIONS_CONFIGURATIONS" Width="1.5" PointX="8.25" PointY="6" /> - <EntityTypeShape EntityType="RemoteModel.MACHINE" Width="1.5" PointX="3" PointY="30.125" /> - <EntityTypeShape EntityType="RemoteModel.MACHINES_CONFIGURATIONS" Width="1.5" PointX="5.25" PointY="2" /> - <EntityTypeShape EntityType="RemoteModel.MACHINES_EVENTS" Width="1.5" PointX="8.25" PointY="30.25" /> - <EntityTypeShape EntityType="RemoteModel.MEDIA_COLORS" Width="1.5" PointX="5.75" PointY="25" /> - <EntityTypeShape EntityType="RemoteModel.MEDIA_CONDITIONS" Width="1.5" PointX="5.75" PointY="31" /> - <EntityTypeShape EntityType="RemoteModel.MEDIA_MATERIALS" Width="1.5" PointX="5.75" PointY="27.875" /> - <EntityTypeShape EntityType="RemoteModel.MEDIA_PURPOSES" Width="1.5" PointX="5.75" PointY="18.75" /> - <EntityTypeShape EntityType="RemoteModel.ORGANIZATION" Width="1.5" PointX="0.75" PointY="31.875" /> - <EntityTypeShape EntityType="RemoteModel.PERMISSION" Width="1.5" PointX="6.75" PointY="44.75" /> - <EntityTypeShape EntityType="RemoteModel.RML" Width="1.5" PointX="8" PointY="10.125" /> - <EntityTypeShape EntityType="RemoteModel.ROLE" Width="1.5" PointX="3.75" PointY="40.625" /> - <EntityTypeShape EntityType="RemoteModel.ROLES_PERMISSIONS" Width="1.5" PointX="9" PointY="40.75" /> - <EntityTypeShape EntityType="RemoteModel.SYNC_CONFIGURATIONS" Width="1.5" PointX="7.75" PointY="1.75" /> - <EntityTypeShape EntityType="RemoteModel.USER" Width="1.5" PointX="3.75" PointY="36.125" /> - <EntityTypeShape EntityType="RemoteModel.USERS_ROLES" Width="1.5" PointX="6" PointY="36.75" /> + <EntityTypeShape EntityType="RemoteModel.ACTION" Width="1.5" PointX="12.5" PointY="41.125" /> + <EntityTypeShape EntityType="RemoteModel.ADDRESS" Width="1.5" PointX="3" PointY="19.5" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_DISPLAY_PANEL_VERSIONS" Width="1.5" PointX="0.75" PointY="26.625" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_FIRMWARE_VERSIONS" Width="1.5" PointX="0.75" PointY="6.75" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_OS_VERSIONS" Width="1.5" PointX="0.75" PointY="11" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_VERSIONS" Width="1.5" PointX="0.75" PointY="23.5" /> + <EntityTypeShape EntityType="RemoteModel.CARTRIDGE_TYPES" Width="1.5" PointX="0.75" PointY="3.5" /> + <EntityTypeShape EntityType="RemoteModel.CARTRIDGE" Width="1.5" PointX="3" PointY="1.125" /> + <EntityTypeShape EntityType="RemoteModel.CONFIGURATION" Width="1.5" PointX="3" PointY="5.125" /> + <EntityTypeShape EntityType="RemoteModel.CONTACT" Width="1.5" PointX="3" PointY="15.375" /> + <EntityTypeShape EntityType="RemoteModel.DISPENSER_TYPES" Width="1.5" PointX="0.75" PointY="30.25" /> + <EntityTypeShape EntityType="RemoteModel.DISPENSER" Width="1.5" PointX="3" PointY="30.125" /> + <EntityTypeShape EntityType="RemoteModel.EMBEDDED_FIRMWARE_VERSIONS" Width="1.5" PointX="0.75" PointY="17.25" /> + <EntityTypeShape EntityType="RemoteModel.EMBEDDED_SOFTWARE_VERSIONS" Width="1.5" PointX="0.75" PointY="20.375" /> + <EntityTypeShape EntityType="RemoteModel.EVENT" Width="1.5" PointX="7.5" PointY="15" /> + <EntityTypeShape EntityType="RemoteModel.EVENTS_ACTIONS" Width="1.5" PointX="14.75" PointY="15.125" /> + <EntityTypeShape EntityType="RemoteModel.FIBER_SHAPES" Width="1.5" PointX="11.75" PointY="4.5" /> + <EntityTypeShape EntityType="RemoteModel.FIBER_SYNTHS" Width="1.5" PointX="11.75" PointY="16.875" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_VERSIONS" Width="1.5" PointX="0.75" PointY="14.125" /> + <EntityTypeShape EntityType="RemoteModel.IDS_PACKS" Width="1.5" PointX="5.25" PointY="6.125" /> + <EntityTypeShape EntityType="RemoteModel.LINEAR_MASS_DENSITY_UNITS" Width="1.5" PointX="11.75" PointY="0.75" /> + <EntityTypeShape EntityType="RemoteModel.LIQUID" Width="1.5" PointX="3" PointY="11.375" /> + <EntityTypeShape EntityType="RemoteModel.LIQUIDS_RMLS" Width="1.5" PointX="16.25" PointY="7" /> + <EntityTypeShape EntityType="RemoteModel.MACHINE_VERSIONS" Width="1.5" PointX="5.25" PointY="10.75" /> + <EntityTypeShape EntityType="RemoteModel.MACHINE" Width="1.5" PointX="7.5" PointY="10.375" /> + <EntityTypeShape EntityType="RemoteModel.MACHINES_CONFIGURATIONS" Width="1.5" PointX="9.75" PointY="8.25" /> + <EntityTypeShape EntityType="RemoteModel.MACHINES_EVENTS" Width="1.5" PointX="9.75" PointY="12.5" /> + <EntityTypeShape EntityType="RemoteModel.MEDIA_COLORS" Width="1.5" PointX="11.75" PointY="26.25" /> + <EntityTypeShape EntityType="RemoteModel.MEDIA_CONDITIONS" Width="1.5" PointX="11.75" PointY="23.125" /> + <EntityTypeShape EntityType="RemoteModel.MEDIA_MATERIALS" Width="1.5" PointX="11.75" PointY="20" /> + <EntityTypeShape EntityType="RemoteModel.MEDIA_PURPOSES" Width="1.5" PointX="11.75" PointY="29.125" /> + <EntityTypeShape EntityType="RemoteModel.ORGANIZATION" Width="1.5" PointX="5.25" PointY="17.625" /> + <EntityTypeShape EntityType="RemoteModel.PERMISSION" Width="1.5" PointX="10.5" PointY="37.125" /> + <EntityTypeShape EntityType="RemoteModel.RML" Width="1.5" PointX="14" PointY="2.25" /> + <EntityTypeShape EntityType="RemoteModel.ROLE" Width="1.5" PointX="10.5" PointY="33" /> + <EntityTypeShape EntityType="RemoteModel.ROLES_PERMISSIONS" Width="1.5" PointX="12.75" PointY="33.125" /> + <EntityTypeShape EntityType="RemoteModel.SYNC_CONFIGURATIONS" Width="1.5" PointX="5.75" PointY="1.875" /> + <EntityTypeShape EntityType="RemoteModel.USER" Width="1.5" PointX="7.5" PointY="5.5" /> + <EntityTypeShape EntityType="RemoteModel.USERS_ROLES" Width="1.5" PointX="12.75" PointY="10.125" /> <AssociationConnector Association="RemoteModel.FK_EVENTS_ACTIONS_ACTIONS" /> <AssociationConnector Association="RemoteModel.FK_ORGANIZATIONS_ADDRESSES" /> <AssociationConnector Association="RemoteModel.FK_USERS_ADDRESSES" /> @@ -54,11 +53,11 @@ <AssociationConnector Association="RemoteModel.FK_CONFIGURATIONS_APPLICATION_VERSIONS" /> <AssociationConnector Association="RemoteModel.FK_CARTRIDGES_CARTRIDGE_TYPES" /> <AssociationConnector Association="RemoteModel.FK_CONFIGURATIONS_DISPENSERS_CARTRIDGES" /> - <AssociationConnector Association="RemoteModel.FK_CONFIGURATIONS_DISPENSERS_CONFIGURATIONS" /> <AssociationConnector Association="RemoteModel.FK_CONFIGURATIONS_EMBEDDED_FIRMWARE_VERSIONS" /> <AssociationConnector Association="RemoteModel.FK_CONFIGURATIONS_EMBEDDED_SOFTWARE_VERSIONS" /> <AssociationConnector Association="RemoteModel.FK_CONFIGURATIONS_HARDWARE_VERSIONS" /> - <AssociationConnector Association="RemoteModel.FK_MACHINE_VERSIONS_CONFIGURATIONS_CONFIGURATIONS" /> + <AssociationConnector Association="RemoteModel.FK_IDS_PACKS_CONFIGURATIONS" /> + <AssociationConnector Association="RemoteModel.FK_MACHINE_VERSIONS_CONFIGURATIONS" /> <AssociationConnector Association="RemoteModel.FK_MACHINES_CONFIGURATIONS_CONFIGURATIONS" /> <AssociationConnector Association="RemoteModel.FK_ORGANIZATIONS_CONTACTS" /> <AssociationConnector Association="RemoteModel.FK_USERS_CONTACTS" /> @@ -72,7 +71,6 @@ <AssociationConnector Association="RemoteModel.FK_RML_LINEAR_MASS_DENSITY_UNITS" /> <AssociationConnector Association="RemoteModel.FK_LIQUIDS_RML_LIQUIDS" /> <AssociationConnector Association="RemoteModel.FK_LIQUIDS_RML_RML" /> - <AssociationConnector Association="RemoteModel.FK_MACHINE_VERSIONS_CONFIGURATIONS_MACHINE_VERSIONS" /> <AssociationConnector Association="RemoteModel.FK_MACHINES_MACHINE_VERSIONS" /> <AssociationConnector Association="RemoteModel.FK_MACHINES_CONFIGURATIONS_MACHINES" /> <AssociationConnector Association="RemoteModel.FK_MACHINES_EVENTS_MACHINES" /> diff --git a/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj b/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj index 6ac6c35c3..a1241d0bc 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj +++ b/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj @@ -116,7 +116,7 @@ <Compile Include="DB\FIBER_SHAPES.cs"> <DependentUpon>RemoteADO.tt</DependentUpon> </Compile> - <Compile Include="DB\FIBER_SYNTHESISES.cs"> + <Compile Include="DB\FIBER_SYNTHS.cs"> <DependentUpon>RemoteADO.tt</DependentUpon> </Compile> <Compile Include="DB\HARDWARE_VERSIONS.cs"> @@ -146,9 +146,6 @@ <Compile Include="DB\MACHINE_VERSIONS.cs"> <DependentUpon>RemoteADO.tt</DependentUpon> </Compile> - <Compile Include="DB\MACHINE_VERSIONS_CONFIGURATIONS.cs"> - <DependentUpon>RemoteADO.tt</DependentUpon> - </Compile> <Compile Include="DB\MEDIA_COLORS.cs"> <DependentUpon>RemoteADO.tt</DependentUpon> </Compile> diff --git a/Software/Visual_Studio/Tango.Settings/MachineStudio.cs b/Software/Visual_Studio/Tango.Settings/MachineStudio.cs new file mode 100644 index 000000000..bc486b6c3 --- /dev/null +++ b/Software/Visual_Studio/Tango.Settings/MachineStudio.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Cryptography; + +namespace Tango.Settings +{ + public class MachineStudio + { + public String LastLoginEmail { get; set; } + + public String LastLoginPassword { get; set; } + + public bool RememberMe { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.Settings/SettingsCollection.cs b/Software/Visual_Studio/Tango.Settings/SettingsCollection.cs index c6f98f187..174be81f0 100644 --- a/Software/Visual_Studio/Tango.Settings/SettingsCollection.cs +++ b/Software/Visual_Studio/Tango.Settings/SettingsCollection.cs @@ -13,12 +13,15 @@ namespace Tango.Settings { public DataBase DataBase { get; set; } + public MachineStudio MachineStudio { get; set; } + /// <summary> /// Initializes a new instance of the <see cref="SettingsCollection"/> class. /// </summary> public SettingsCollection() { DataBase = new DataBase(); + MachineStudio = new MachineStudio(); } } } diff --git a/Software/Visual_Studio/Tango.Settings/Tango.Settings.csproj b/Software/Visual_Studio/Tango.Settings/Tango.Settings.csproj index 2d77a1b02..4b57b1f4d 100644 --- a/Software/Visual_Studio/Tango.Settings/Tango.Settings.csproj +++ b/Software/Visual_Studio/Tango.Settings/Tango.Settings.csproj @@ -44,6 +44,7 @@ <Link>GlobalVersionInfo.cs</Link> </Compile> <Compile Include="DataBase.cs" /> + <Compile Include="MachineStudio.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="SettingsCollection.cs" /> <Compile Include="SettingsManager.cs" /> diff --git a/Software/Visual_Studio/Tango.SharedUI/Controls/MultiTransitionControl.xaml.cs b/Software/Visual_Studio/Tango.SharedUI/Controls/MultiTransitionControl.xaml.cs index 83cb49de2..8a74753f3 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Controls/MultiTransitionControl.xaml.cs +++ b/Software/Visual_Studio/Tango.SharedUI/Controls/MultiTransitionControl.xaml.cs @@ -466,6 +466,19 @@ namespace Tango.SharedUI.Controls navigationCompleteAction(); navigationCompleteAction = null; } + + if (SelectedControl != null) + { + if (SelectedControl.Content is ITransitionView) + { + (SelectedControl.Content as ITransitionView).OnTransitionCompleted(); + } + } + } + + public interface ITransitionView + { + void OnTransitionCompleted(); } #endregion diff --git a/Software/Visual_Studio/Tango.SharedUI/Converters/ColorToIntegerConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Converters/ColorToIntegerConverter.cs new file mode 100644 index 000000000..ef0896395 --- /dev/null +++ b/Software/Visual_Studio/Tango.SharedUI/Converters/ColorToIntegerConverter.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using System.Windows.Media; +using Tango.Core.Helpers; + +namespace Tango.SharedUI.Converters +{ + public class ColorToIntegerConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return ColorHelper.IntegerToColor((int)value); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return ColorHelper.ColorToInteger((Color)value); + } + } +} diff --git a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj index 228322297..3d8bc2701 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj +++ b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj @@ -48,6 +48,7 @@ <HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath> </Reference> <Reference Include="System" /> + <Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.Data" /> <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\System.Windows.Interactivity.dll</HintPath> @@ -81,6 +82,7 @@ <Compile Include="Converters\BooleanInverseConverter.cs" /> <Compile Include="Converters\BooleanToVisibilityConverter.cs" /> <Compile Include="Converters\BooleanToVisibilityInverseConverter.cs" /> + <Compile Include="Converters\ColorToIntegerConverter.cs" /> <Compile Include="Converters\DoubleToIntConverter.cs" /> <Compile Include="Converters\EnumToDescriptionConverter.cs" /> <Compile Include="Converters\EnumToItemsSourceConverter.cs" /> diff --git a/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs b/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs index 281a6c03d..0dac0ce48 100644 --- a/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs +++ b/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs @@ -1,6 +1,10 @@ using System; +using System.Collections; using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; using System.Linq; +using System.Reflection; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -8,9 +12,56 @@ using Tango.Core; namespace Tango.SharedUI { - public abstract class ViewModel : ExtendedObject + public abstract class ViewModel : ExtendedObject, INotifyDataErrorInfo { + private List<KeyValuePair<String, String>> _currentErrors = new List<KeyValuePair<string, string>>(); + private bool _hasErrors; + public bool HasErrors + { + get { return _hasErrors; } + set { _hasErrors = value; RaisePropertyChangedAuto(); } + } + + public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged; + + public virtual IEnumerable GetErrors(string propertyName) + { + return _currentErrors.Where(x => x.Key == propertyName).Select(x => x.Value).ToList(); + } + + protected void RaiseError(String propName) + { + ErrorsChanged?.Invoke(this, new DataErrorsChangedEventArgs(propName)); + } + + protected bool Validate() + { + OnValidating(); + + HasErrors = false; + _currentErrors.Clear(); + + foreach (var prop in this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) + { + foreach (var validation in prop.GetCustomAttributes<ValidationAttribute>()) + { + if (!validation.IsValid(prop.GetValue(this))) + { + HasErrors = true; + _currentErrors.Add(new KeyValuePair<string, string>(prop.Name, validation.ErrorMessage)); + RaiseError(prop.Name); + } + } + } + + return !HasErrors; + } + + protected virtual void OnValidating() + { + + } } public abstract class ViewModel<T> : ViewModel where T : IView @@ -29,13 +80,13 @@ namespace Tango.SharedUI public ViewModel(T view, bool delayed) { - Task.Factory.StartNew(() => + Task.Factory.StartNew(() => { while (view == null) { Thread.Sleep(10); } - }).ContinueWith((c) => + }).ContinueWith((c) => { View = view; View.ViewAttached += (x, e) => diff --git a/Software/Visual_Studio/Tango.UnitTesting/CodeGeneration_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/CodeGeneration_TST.cs index abdded03e..a5f62b4a4 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/CodeGeneration_TST.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/CodeGeneration_TST.cs @@ -18,7 +18,7 @@ namespace Tango.UnitTesting String tempPath = Helper.GetTempFolderPath(); ObservablesGenerator generator = new ObservablesGenerator(); - generator.Generate(tempPath); + generator.GenerateCSharp(tempPath); Helper.ShowInExplorer(tempPath); } diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln index 53f85835e..831c15e13 100644 --- a/Software/Visual_Studio/Tango.sln +++ b/Software/Visual_Studio/Tango.sln @@ -1,7 +1,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26430.16 +VisualStudioVersion = 15.0.26430.14 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Protobuf", "Tango.Protobuf\Tango.Protobuf.csproj", "{40073806-914E-4E78-97AB-FA9639308EBE}" EndProject @@ -93,6 +93,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.MachineStudio.Common" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.MachineStudio.Developer", "MachineStudio\Modules\Tango.MachineStudio.Developer\Tango.MachineStudio.Developer.csproj", "{CE4A0D11-08A2-4CD6-9908-D6C62E80D805}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.ColorPicker", "Tango.ColorPicker\Tango.ColorPicker.csproj", "{A2F5AF44-29FF-45D6-9D25-ECDA5CCE88B5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -508,6 +510,18 @@ Global {CE4A0D11-08A2-4CD6-9908-D6C62E80D805}.Release|x64.Build.0 = Release|Any CPU {CE4A0D11-08A2-4CD6-9908-D6C62E80D805}.Release|x86.ActiveCfg = Release|Any CPU {CE4A0D11-08A2-4CD6-9908-D6C62E80D805}.Release|x86.Build.0 = Release|Any CPU + {A2F5AF44-29FF-45D6-9D25-ECDA5CCE88B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A2F5AF44-29FF-45D6-9D25-ECDA5CCE88B5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A2F5AF44-29FF-45D6-9D25-ECDA5CCE88B5}.Debug|x64.ActiveCfg = Debug|Any CPU + {A2F5AF44-29FF-45D6-9D25-ECDA5CCE88B5}.Debug|x64.Build.0 = Debug|Any CPU + {A2F5AF44-29FF-45D6-9D25-ECDA5CCE88B5}.Debug|x86.ActiveCfg = Debug|Any CPU + {A2F5AF44-29FF-45D6-9D25-ECDA5CCE88B5}.Debug|x86.Build.0 = Debug|Any CPU + {A2F5AF44-29FF-45D6-9D25-ECDA5CCE88B5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A2F5AF44-29FF-45D6-9D25-ECDA5CCE88B5}.Release|Any CPU.Build.0 = Release|Any CPU + {A2F5AF44-29FF-45D6-9D25-ECDA5CCE88B5}.Release|x64.ActiveCfg = Release|Any CPU + {A2F5AF44-29FF-45D6-9D25-ECDA5CCE88B5}.Release|x64.Build.0 = Release|Any CPU + {A2F5AF44-29FF-45D6-9D25-ECDA5CCE88B5}.Release|x86.ActiveCfg = Release|Any CPU + {A2F5AF44-29FF-45D6-9D25-ECDA5CCE88B5}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Program.cs b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Program.cs index 742b1428d..1b9b4c96a 100644 --- a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Program.cs +++ b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Program.cs @@ -15,23 +15,26 @@ namespace Tango.DBObservablesGenerator.CLI { try { - if (args == null || args.Length == 0) + if (args == null || args.Length < 2) { ExitError("Invalid arguments!"); } String targetPath = args[0]; + String language = args[1]; ObservablesGenerator generator = new ObservablesGenerator(); - foreach (var file in Directory.GetFiles(targetPath)) - { - PathHelper.TryDeleteFile(file); - } - try { - generator.Generate(targetPath); + if (language.ToLower() == "-csharp") + { + generator.GenerateCSharp(targetPath); + } + else if (language.ToLower() == "-java") + { + generator.GenerateJava(targetPath); + } } catch (Exception ex) { |
