diff options
| author | Avi Levkovich <avi@twine-s.com> | 2020-04-28 12:27:25 +0300 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2020-04-28 12:27:25 +0300 |
| commit | 064aaf993d9c38a64f75ea0abf79ced58bdb0741 (patch) | |
| tree | 9ed65b86a9660ce1b1f5609467fa98e4bc29b26b /Software | |
| parent | 806af0415d6ef60a88e6a488ff1972562cbb3842 (diff) | |
| parent | ef6dc2511590085b7aed10b0a37631ce93a3fa00 (diff) | |
| download | Tango-064aaf993d9c38a64f75ea0abf79ced58bdb0741.tar.gz Tango-064aaf993d9c38a64f75ea0abf79ced58bdb0741.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software')
158 files changed, 8060 insertions, 616 deletions
diff --git a/Software/DB/TCC/TCC.mdf b/Software/DB/TCC/TCC.mdf Binary files differindex 55f397ec0..1bfc9bd30 100644 --- a/Software/DB/TCC/TCC.mdf +++ b/Software/DB/TCC/TCC.mdf diff --git a/Software/DB/TCC/TCC_log.ldf b/Software/DB/TCC/TCC_log.ldf Binary files differindex 8e326c1e0..331922388 100644 --- a/Software/DB/TCC/TCC_log.ldf +++ b/Software/DB/TCC/TCC_log.ldf diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf Binary files differindex e2f940f6a..3a90c8fd9 100644 --- a/Software/DB/Tango.mdf +++ b/Software/DB/Tango.mdf diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf Binary files differindex 677ff5b5f..4707ee83d 100644 --- a/Software/DB/Tango_log.ldf +++ b/Software/DB/Tango_log.ldf diff --git a/Software/Embedded_SW/Embedded/.cproject b/Software/Embedded_SW/Embedded/.cproject index 1410af308..388976f56 100644 --- a/Software/Embedded_SW/Embedded/.cproject +++ b/Software/Embedded_SW/Embedded/.cproject @@ -288,7 +288,7 @@ </extensions> </storageModule> <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="builds also the PMR" errorParsers="org.eclipse.rtsc.xdctools.parsers.ErrorParser;com.ti.ccstudio.errorparser.CoffErrorParser;com.ti.ccstudio.errorparser.LinkErrorParser;com.ti.ccstudio.errorparser.AsmErrorParser;org.eclipse.cdt.core.GmakeErrorParser" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.87225697.838615887" name="debug_w_pmr" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug" postbuildStep=""${CCS_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/armofd" "${CG_TOOL_ROOT}/bin/armhex" "${CCS_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin";" prebuildStep=""../../../Visual_Studio/Build/Debug/proto-tc.exe" -i ../../../PMR/Messages -o ../Communication/PMR -l C -c"Common,Connection,Diagnostics,Hardware,Printing,Debugging,Stubs,IO,FirmwareUpgrade,EmbeddedParameters,MachineStatus,Power,ThreadLoading";"> + <configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="builds also the PMR" errorParsers="org.eclipse.rtsc.xdctools.parsers.ErrorParser;com.ti.ccstudio.errorparser.CoffErrorParser;com.ti.ccstudio.errorparser.LinkErrorParser;com.ti.ccstudio.errorparser.AsmErrorParser;org.eclipse.cdt.core.GmakeErrorParser" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.87225697.838615887" name="debug_w_pmr" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug" postbuildStep=""${CCS_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/armofd" "${CG_TOOL_ROOT}/bin/armhex" "${CCS_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin";" prebuildStep=""../../../Visual_Studio/Build/utilities/Debug/proto-tc.exe" -m -i ../../../PMR/Messages -o ../Communication/PMR -l C -c"Common,Connection,Diagnostics,Hardware,Printing,Debugging,Stubs,IO,FirmwareUpgrade,EmbeddedParameters,MachineStatus,Power,ThreadLoading";"> <folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.87225697.838615887." name="/" resourcePath=""> <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_16.9.exe.DebugToolchain.374121404" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.9.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_16.9.exe.linkerDebug.2015775392"> <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1715586318" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> diff --git a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c index 6ba96b079..b0ac5969a 100644 --- a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c +++ b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c @@ -20,7 +20,7 @@ typedef struct } TangoVersion_t; -TangoVersion_t _gTangoVersion = {1,4,6,21}; +TangoVersion_t _gTangoVersion = {1,4,6,22}; #define BUILD_DATE __DATE__ char Dat[50] = BUILD_DATE; char _gTangoName [MAX_STRING_LEN] = "Tango01 ";//d diff --git a/Software/Embedded_SW/Embedded/Communication/Container.c b/Software/Embedded_SW/Embedded/Communication/Container.c index c35b0ca45..2778c5e3e 100644 --- a/Software/Embedded_SW/Embedded/Communication/Container.c +++ b/Software/Embedded_SW/Embedded/Communication/Container.c @@ -487,6 +487,12 @@ void receive_callback(char* buffer, size_t length) case MESSAGE_TYPE__DispenserEEpromRequest: DispenserEEpromRequestFunc(requestContainer); break; + case MESSAGE_TYPE__StubDispenserEEpromRequest: + StubDispenserEEpromRequestFunc(requestContainer); + break; + case MESSAGE_TYPE__StubWHSEEpromRequest: + WhsEEpromRequestFunc(requestContainer); + break; default: //unsupported message type !! LOG_ERROR (requestContainer->type,"unsupported message type"); diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.c index e05a3f251..b7bc94a45 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.c @@ -7,7 +7,7 @@ #endif #include "MessageType.pb-c.h" -static const ProtobufCEnumValue message_type__enum_values_by_number[247] = +static const ProtobufCEnumValue message_type__enum_values_by_number[251] = { { "", "", 0 }, { "", "", 1 }, @@ -113,6 +113,10 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[247] = { "", "", 102 }, { "", "", 103 }, { "", "", 104 }, + { "", "", 105 }, + { "", "", 106 }, + { "", "", 107 }, + { "", "", 108 }, { "", "", 1000 }, { "", "", 1001 }, { "", "", 1002 }, @@ -258,145 +262,145 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[247] = { "", "", 11005 }, }; static const ProtobufCIntRange message_type__value_ranges[] = { -{0, 0},{3, 2},{1000, 104},{2000, 123},{3000, 171},{4000, 185},{5000, 193},{6000, 197},{7000, 203},{8000, 227},{9000, 233},{10000, 237},{11000, 241},{0, 247} +{0, 0},{3, 2},{1000, 108},{2000, 127},{3000, 175},{4000, 189},{5000, 197},{6000, 201},{7000, 207},{8000, 231},{9000, 237},{10000, 241},{11000, 245},{0, 251} }; -static const ProtobufCEnumValueIndex message_type__enum_values_by_name[247] = +static const ProtobufCEnumValueIndex message_type__enum_values_by_name[251] = { - { "", 183 }, - { "", 184 }, - { "", 173 }, - { "", 174 }, - { "", 239 }, - { "", 240 }, - { "", 225 }, - { "", 226 }, - { "", 2 }, - { "", 3 }, - { "", 167 }, - { "", 168 }, - { "", 117 }, - { "", 118 }, - { "", 199 }, - { "", 200 }, + { "", 187 }, + { "", 188 }, + { "", 177 }, + { "", 178 }, { "", 243 }, { "", 244 }, + { "", 229 }, + { "", 230 }, + { "", 2 }, + { "", 3 }, + { "", 171 }, + { "", 172 }, + { "", 121 }, + { "", 122 }, + { "", 203 }, + { "", 204 }, + { "", 247 }, + { "", 248 }, + { "", 215 }, + { "", 216 }, + { "", 181 }, + { "", 182 }, + { "", 217 }, + { "", 218 }, + { "", 113 }, + { "", 114 }, + { "", 205 }, + { "", 206 }, + { "", 137 }, + { "", 138 }, + { "", 143 }, + { "", 144 }, + { "", 231 }, + { "", 232 }, + { "", 173 }, + { "", 174 }, + { "", 139 }, + { "", 140 }, + { "", 141 }, + { "", 142 }, + { "", 1 }, { "", 211 }, { "", 212 }, - { "", 177 }, - { "", 178 }, - { "", 213 }, - { "", 214 }, { "", 109 }, { "", 110 }, - { "", 201 }, - { "", 202 }, - { "", 133 }, - { "", 134 }, - { "", 139 }, - { "", 140 }, - { "", 227 }, - { "", 228 }, - { "", 169 }, - { "", 170 }, - { "", 135 }, - { "", 136 }, - { "", 137 }, - { "", 138 }, - { "", 1 }, + { "", 111 }, + { "", 112 }, + { "", 108 }, + { "", 225 }, + { "", 226 }, + { "", 209 }, + { "", 210 }, + { "", 223 }, + { "", 224 }, { "", 207 }, { "", 208 }, - { "", 105 }, - { "", 106 }, - { "", 107 }, - { "", 108 }, - { "", 104 }, + { "", 125 }, + { "", 126 }, { "", 221 }, { "", 222 }, - { "", 205 }, - { "", 206 }, { "", 219 }, { "", 220 }, - { "", 203 }, - { "", 204 }, - { "", 121 }, - { "", 122 }, - { "", 217 }, - { "", 218 }, - { "", 215 }, - { "", 216 }, - { "", 171 }, - { "", 172 }, - { "", 197 }, - { "", 198 }, - { "", 209 }, - { "", 210 }, - { "", 231 }, - { "", 232 }, - { "", 229 }, - { "", 230 }, - { "", 125 }, - { "", 126 }, - { "", 131 }, - { "", 132 }, - { "", 127 }, - { "", 128 }, + { "", 175 }, + { "", 176 }, + { "", 201 }, + { "", 202 }, + { "", 213 }, + { "", 214 }, + { "", 235 }, + { "", 236 }, + { "", 233 }, + { "", 234 }, { "", 129 }, { "", 130 }, + { "", 135 }, + { "", 136 }, + { "", 131 }, + { "", 132 }, + { "", 133 }, + { "", 134 }, { "", 0 }, - { "", 111 }, - { "", 112 }, + { "", 115 }, + { "", 116 }, { "", 4 }, { "", 5 }, - { "", 149 }, - { "", 150 }, - { "", 179 }, - { "", 180 }, - { "", 159 }, - { "", 160 }, - { "", 147 }, - { "", 148 }, + { "", 153 }, + { "", 154 }, + { "", 183 }, + { "", 184 }, + { "", 163 }, + { "", 164 }, + { "", 151 }, + { "", 152 }, + { "", 193 }, + { "", 194 }, + { "", 145 }, + { "", 146 }, + { "", 161 }, + { "", 162 }, + { "", 165 }, + { "", 166 }, + { "", 195 }, + { "", 196 }, + { "", 117 }, + { "", 118 }, + { "", 167 }, + { "", 168 }, { "", 189 }, { "", 190 }, - { "", 141 }, - { "", 142 }, + { "", 127 }, + { "", 128 }, { "", 157 }, { "", 158 }, - { "", 161 }, - { "", 162 }, - { "", 191 }, - { "", 192 }, - { "", 113 }, - { "", 114 }, - { "", 163 }, - { "", 164 }, { "", 185 }, { "", 186 }, - { "", 123 }, - { "", 124 }, - { "", 153 }, - { "", 154 }, - { "", 181 }, - { "", 182 }, - { "", 233 }, - { "", 234 }, { "", 237 }, { "", 238 }, { "", 241 }, { "", 242 }, - { "", 115 }, - { "", 116 }, - { "", 165 }, - { "", 166 }, - { "", 187 }, - { "", 188 }, - { "", 151 }, - { "", 152 }, - { "", 155 }, - { "", 156 }, - { "", 235 }, - { "", 236 }, { "", 245 }, { "", 246 }, + { "", 119 }, + { "", 120 }, + { "", 169 }, + { "", 170 }, + { "", 191 }, + { "", 192 }, + { "", 155 }, + { "", 156 }, + { "", 159 }, + { "", 160 }, + { "", 239 }, + { "", 240 }, + { "", 249 }, + { "", 250 }, { "", 100 }, { "", 101 }, { "", 6 }, @@ -405,6 +409,8 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[247] = { "", 9 }, { "", 80 }, { "", 81 }, + { "", 104 }, + { "", 105 }, { "", 10 }, { "", 11 }, { "", 32 }, @@ -495,20 +501,22 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[247] = { "", 79 }, { "", 30 }, { "", 31 }, - { "", 195 }, - { "", 196 }, - { "", 145 }, - { "", 146 }, - { "", 143 }, - { "", 144 }, - { "", 119 }, - { "", 120 }, - { "", 193 }, - { "", 194 }, - { "", 175 }, - { "", 176 }, - { "", 223 }, - { "", 224 }, + { "", 106 }, + { "", 107 }, + { "", 199 }, + { "", 200 }, + { "", 149 }, + { "", 150 }, + { "", 147 }, + { "", 148 }, + { "", 123 }, + { "", 124 }, + { "", 197 }, + { "", 198 }, + { "", 179 }, + { "", 180 }, + { "", 227 }, + { "", 228 }, }; const ProtobufCEnumDescriptor message_type__descriptor = { @@ -517,9 +525,9 @@ const ProtobufCEnumDescriptor message_type__descriptor = "", "", "", - 247, + 251, message_type__enum_values_by_number, - 247, + 251, message_type__enum_values_by_name, 13, message_type__value_ranges, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.h index fdc7d1bd8..4ea1c7763 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.h @@ -124,6 +124,10 @@ typedef enum _MessageType { MESSAGE_TYPE__StubAbortJobResponse = 102, MESSAGE_TYPE__StubMidTankPressureSensorRequest = 103, MESSAGE_TYPE__StubMidTankPressureSensorResponse = 104, + MESSAGE_TYPE__StubDispenserEEpromRequest = 105, + MESSAGE_TYPE__StubDispenserEEpromResponse = 106, + MESSAGE_TYPE__StubWHSEEpromRequest = 107, + MESSAGE_TYPE__StubWHSEEpromResponse = 108, MESSAGE_TYPE__ExternalBridgeUdpDiscoveryPacket = 1000, MESSAGE_TYPE__ExternalBridgeLoginRequest = 1001, MESSAGE_TYPE__ExternalBridgeLoginResponse = 1002, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEPROM.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEPROM.pb-c.c index ac762deec..490336ab8 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEPROM.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEPROM.pb-c.c @@ -7,60 +7,60 @@ #endif #include "DispenserEEPROM.pb-c.h" -void dispenser_eeprom__init - (DispenserEEprom *message) +void dispenser_eeprom_info__init + (DispenserEEpromInfo *message) { - static const DispenserEEprom init_value = DISPENSER_EEPROM__INIT; + static const DispenserEEpromInfo init_value = DISPENSER_EEPROM_INFO__INIT; *message = init_value; } -size_t dispenser_eeprom__get_packed_size - (const DispenserEEprom *message) +size_t dispenser_eeprom_info__get_packed_size + (const DispenserEEpromInfo *message) { - assert(message->base.descriptor == &dispenser_eeprom__descriptor); + assert(message->base.descriptor == &dispenser_eeprom_info__descriptor); return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); } -size_t dispenser_eeprom__pack - (const DispenserEEprom *message, +size_t dispenser_eeprom_info__pack + (const DispenserEEpromInfo *message, uint8_t *out) { - assert(message->base.descriptor == &dispenser_eeprom__descriptor); + assert(message->base.descriptor == &dispenser_eeprom_info__descriptor); return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); } -size_t dispenser_eeprom__pack_to_buffer - (const DispenserEEprom *message, +size_t dispenser_eeprom_info__pack_to_buffer + (const DispenserEEpromInfo *message, ProtobufCBuffer *buffer) { - assert(message->base.descriptor == &dispenser_eeprom__descriptor); + assert(message->base.descriptor == &dispenser_eeprom_info__descriptor); return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); } -DispenserEEprom * - dispenser_eeprom__unpack +DispenserEEpromInfo * + dispenser_eeprom_info__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { - return (DispenserEEprom *) - protobuf_c_message_unpack (&dispenser_eeprom__descriptor, + return (DispenserEEpromInfo *) + protobuf_c_message_unpack (&dispenser_eeprom_info__descriptor, allocator, len, data); } -void dispenser_eeprom__free_unpacked - (DispenserEEprom *message, +void dispenser_eeprom_info__free_unpacked + (DispenserEEpromInfo *message, ProtobufCAllocator *allocator) { if(!message) return; - assert(message->base.descriptor == &dispenser_eeprom__descriptor); + assert(message->base.descriptor == &dispenser_eeprom_info__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = +static const ProtobufCFieldDescriptor dispenser_eeprom_info__field_descriptors[32] = { { "", 1, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, - offsetof(DispenserEEprom, has_header), - offsetof(DispenserEEprom, header), + offsetof(DispenserEEpromInfo, has_header), + offsetof(DispenserEEpromInfo, header), NULL, NULL, 0, /* flags */ @@ -71,8 +71,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 2, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, - offsetof(DispenserEEprom, has_tablelength), - offsetof(DispenserEEprom, tablelength), + offsetof(DispenserEEpromInfo, has_tablelength), + offsetof(DispenserEEpromInfo, tablelength), NULL, NULL, 0, /* flags */ @@ -83,8 +83,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 3, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, - offsetof(DispenserEEprom, has_tableversion), - offsetof(DispenserEEprom, tableversion), + offsetof(DispenserEEpromInfo, has_tableversion), + offsetof(DispenserEEpromInfo, tableversion), NULL, NULL, 0, /* flags */ @@ -96,7 +96,7 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ - offsetof(DispenserEEprom, dispenserp_n), + offsetof(DispenserEEpromInfo, dispenserp_n), NULL, NULL, 0, /* flags */ @@ -108,7 +108,7 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ - offsetof(DispenserEEprom, pcbs_n), + offsetof(DispenserEEpromInfo, pcbs_n), NULL, NULL, 0, /* flags */ @@ -120,7 +120,7 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ - offsetof(DispenserEEprom, pcbpartnumber), + offsetof(DispenserEEpromInfo, pcbpartnumber), NULL, NULL, 0, /* flags */ @@ -132,7 +132,7 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ - offsetof(DispenserEEprom, dispensers_n), + offsetof(DispenserEEpromInfo, dispensers_n), NULL, NULL, 0, /* flags */ @@ -143,8 +143,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 8, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, - offsetof(DispenserEEprom, has_minimalpressure), - offsetof(DispenserEEprom, minimalpressure), + offsetof(DispenserEEpromInfo, has_minimalpressure), + offsetof(DispenserEEpromInfo, minimalpressure), NULL, NULL, 0, /* flags */ @@ -155,8 +155,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 9, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, - offsetof(DispenserEEprom, has_maximalpressure), - offsetof(DispenserEEprom, maximalpressure), + offsetof(DispenserEEpromInfo, has_maximalpressure), + offsetof(DispenserEEpromInfo, maximalpressure), NULL, NULL, 0, /* flags */ @@ -167,8 +167,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 10, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, - offsetof(DispenserEEprom, has_minimalmv), - offsetof(DispenserEEprom, minimalmv), + offsetof(DispenserEEpromInfo, has_minimalmv), + offsetof(DispenserEEpromInfo, minimalmv), NULL, NULL, 0, /* flags */ @@ -179,8 +179,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 11, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, - offsetof(DispenserEEprom, has_maximalmv), - offsetof(DispenserEEprom, maximalmv), + offsetof(DispenserEEpromInfo, has_maximalmv), + offsetof(DispenserEEpromInfo, maximalmv), NULL, NULL, 0, /* flags */ @@ -191,8 +191,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 12, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, - offsetof(DispenserEEprom, has_totalcycles), - offsetof(DispenserEEprom, totalcycles), + offsetof(DispenserEEpromInfo, has_totalcycles), + offsetof(DispenserEEpromInfo, totalcycles), NULL, NULL, 0, /* flags */ @@ -203,8 +203,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 13, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, - offsetof(DispenserEEprom, has_bubblesize), - offsetof(DispenserEEprom, bubblesize), + offsetof(DispenserEEpromInfo, has_bubblesize), + offsetof(DispenserEEpromInfo, bubblesize), NULL, NULL, 0, /* flags */ @@ -215,8 +215,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 14, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, - offsetof(DispenserEEprom, has_avg_nl_stepvalue_1_4), - offsetof(DispenserEEprom, avg_nl_stepvalue_1_4), + offsetof(DispenserEEpromInfo, has_avg_nl_stepvalue_1_4), + offsetof(DispenserEEpromInfo, avg_nl_stepvalue_1_4), NULL, NULL, 0, /* flags */ @@ -227,8 +227,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 15, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, - offsetof(DispenserEEprom, has_avg_nl_stepvalue_2_4), - offsetof(DispenserEEprom, avg_nl_stepvalue_2_4), + offsetof(DispenserEEpromInfo, has_avg_nl_stepvalue_2_4), + offsetof(DispenserEEpromInfo, avg_nl_stepvalue_2_4), NULL, NULL, 0, /* flags */ @@ -239,8 +239,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 16, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, - offsetof(DispenserEEprom, has_avg_nl_stepvalue_3_4), - offsetof(DispenserEEprom, avg_nl_stepvalue_3_4), + offsetof(DispenserEEpromInfo, has_avg_nl_stepvalue_3_4), + offsetof(DispenserEEpromInfo, avg_nl_stepvalue_3_4), NULL, NULL, 0, /* flags */ @@ -251,8 +251,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 17, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, - offsetof(DispenserEEprom, has_avg_nl_stepvalue_4_4), - offsetof(DispenserEEprom, avg_nl_stepvalue_4_4), + offsetof(DispenserEEpromInfo, has_avg_nl_stepvalue_4_4), + offsetof(DispenserEEpromInfo, avg_nl_stepvalue_4_4), NULL, NULL, 0, /* flags */ @@ -263,8 +263,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 18, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, - offsetof(DispenserEEprom, has_sw_reserve), - offsetof(DispenserEEprom, sw_reserve), + offsetof(DispenserEEpromInfo, has_sw_reserve), + offsetof(DispenserEEpromInfo, sw_reserve), NULL, NULL, 0, /* flags */ @@ -275,8 +275,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 19, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_INT32, - offsetof(DispenserEEprom, has_spare1_pressure), - offsetof(DispenserEEprom, spare1_pressure), + offsetof(DispenserEEpromInfo, has_spare1_pressure), + offsetof(DispenserEEpromInfo, spare1_pressure), NULL, NULL, 0, /* flags */ @@ -287,8 +287,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 20, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_INT32, - offsetof(DispenserEEprom, has_spare2_pressure), - offsetof(DispenserEEprom, spare2_pressure), + offsetof(DispenserEEpromInfo, has_spare2_pressure), + offsetof(DispenserEEpromInfo, spare2_pressure), NULL, NULL, 0, /* flags */ @@ -299,8 +299,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 21, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, - offsetof(DispenserEEprom, has_motorpulsespercycle), - offsetof(DispenserEEprom, motorpulsespercycle), + offsetof(DispenserEEpromInfo, has_motorpulsespercycle), + offsetof(DispenserEEpromInfo, motorpulsespercycle), NULL, NULL, 0, /* flags */ @@ -311,8 +311,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 22, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, - offsetof(DispenserEEprom, has_color), - offsetof(DispenserEEprom, color), + offsetof(DispenserEEpromInfo, has_color), + offsetof(DispenserEEpromInfo, color), NULL, NULL, 0, /* flags */ @@ -323,8 +323,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 23, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, - offsetof(DispenserEEprom, has_pressureslope), - offsetof(DispenserEEprom, pressureslope), + offsetof(DispenserEEpromInfo, has_pressureslope), + offsetof(DispenserEEpromInfo, pressureslope), NULL, NULL, 0, /* flags */ @@ -336,7 +336,7 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ - offsetof(DispenserEEprom, productiondate), + offsetof(DispenserEEpromInfo, productiondate), NULL, NULL, 0, /* flags */ @@ -347,8 +347,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 25, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, - offsetof(DispenserEEprom, has_atslocation), - offsetof(DispenserEEprom, atslocation), + offsetof(DispenserEEpromInfo, has_atslocation), + offsetof(DispenserEEpromInfo, atslocation), NULL, NULL, 0, /* flags */ @@ -359,8 +359,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 26, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, - offsetof(DispenserEEprom, has_spare1), - offsetof(DispenserEEprom, spare1), + offsetof(DispenserEEpromInfo, has_spare1), + offsetof(DispenserEEpromInfo, spare1), NULL, NULL, 0, /* flags */ @@ -371,8 +371,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 27, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, - offsetof(DispenserEEprom, has_spare2), - offsetof(DispenserEEprom, spare2), + offsetof(DispenserEEpromInfo, has_spare2), + offsetof(DispenserEEpromInfo, spare2), NULL, NULL, 0, /* flags */ @@ -383,8 +383,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 28, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, - offsetof(DispenserEEprom, has_atschannel), - offsetof(DispenserEEprom, atschannel), + offsetof(DispenserEEpromInfo, has_atschannel), + offsetof(DispenserEEpromInfo, atschannel), NULL, NULL, 0, /* flags */ @@ -395,8 +395,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 29, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_BOOL, - offsetof(DispenserEEprom, has_unitempty), - offsetof(DispenserEEprom, unitempty), + offsetof(DispenserEEpromInfo, has_unitempty), + offsetof(DispenserEEpromInfo, unitempty), NULL, NULL, 0, /* flags */ @@ -407,8 +407,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 30, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_BOOL, - offsetof(DispenserEEprom, has_dryrunpass_fail), - offsetof(DispenserEEprom, dryrunpass_fail), + offsetof(DispenserEEpromInfo, has_dryrunpass_fail), + offsetof(DispenserEEpromInfo, dryrunpass_fail), NULL, NULL, 0, /* flags */ @@ -419,8 +419,8 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = 31, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_BOOL, - offsetof(DispenserEEprom, has_flowpass_fail), - offsetof(DispenserEEprom, flowpass_fail), + offsetof(DispenserEEpromInfo, has_flowpass_fail), + offsetof(DispenserEEpromInfo, flowpass_fail), NULL, NULL, 0, /* flags */ @@ -430,16 +430,16 @@ static const ProtobufCFieldDescriptor dispenser_eeprom__field_descriptors[32] = "", 32, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_BOOL, - offsetof(DispenserEEprom, has_checksum), - offsetof(DispenserEEprom, checksum), + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromInfo, has_checksum), + offsetof(DispenserEEpromInfo, checksum), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned dispenser_eeprom__field_indices_by_name[] = { +static const unsigned dispenser_eeprom_info__field_indices_by_name[] = { 27, /* field[27] = ATSChannel */ 24, /* field[24] = ATSlocation */ 13, /* field[13] = AVG_Nl_stepValue_1_4 */ @@ -473,23 +473,23 @@ static const unsigned dispenser_eeprom__field_indices_by_name[] = { 11, /* field[11] = TotalCycles */ 28, /* field[28] = UnitEmpty */ }; -static const ProtobufCIntRange dispenser_eeprom__number_ranges[1 + 1] = +static const ProtobufCIntRange dispenser_eeprom_info__number_ranges[1 + 1] = { { 1, 0 }, { 0, 32 } }; -const ProtobufCMessageDescriptor dispenser_eeprom__descriptor = +const ProtobufCMessageDescriptor dispenser_eeprom_info__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, "", "", "", "", - sizeof(DispenserEEprom), + sizeof(DispenserEEpromInfo), 32, - dispenser_eeprom__field_descriptors, - dispenser_eeprom__field_indices_by_name, - 1, dispenser_eeprom__number_ranges, - (ProtobufCMessageInit) dispenser_eeprom__init, + dispenser_eeprom_info__field_descriptors, + dispenser_eeprom_info__field_indices_by_name, + 1, dispenser_eeprom_info__number_ranges, + (ProtobufCMessageInit) dispenser_eeprom_info__init, NULL,NULL,NULL /* reserved[123] */ }; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEPROM.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEPROM.pb-c.h index 34b9b333d..4791f24f8 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEPROM.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEPROM.pb-c.h @@ -15,7 +15,7 @@ PROTOBUF_C__BEGIN_DECLS #endif -typedef struct _DispenserEEprom DispenserEEprom; +typedef struct _DispenserEEpromInfo DispenserEEpromInfo; /* --- enums --- */ @@ -23,7 +23,7 @@ typedef struct _DispenserEEprom DispenserEEprom; /* --- messages --- */ -struct _DispenserEEprom +struct _DispenserEEpromInfo { ProtobufCMessage base; protobuf_c_boolean has_header; @@ -84,36 +84,36 @@ struct _DispenserEEprom protobuf_c_boolean has_flowpass_fail; protobuf_c_boolean flowpass_fail; protobuf_c_boolean has_checksum; - protobuf_c_boolean checksum; + uint32_t checksum; }; -#define DISPENSER_EEPROM__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&dispenser_eeprom__descriptor) \ +#define DISPENSER_EEPROM_INFO__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&dispenser_eeprom_info__descriptor) \ , 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } -/* DispenserEEprom methods */ -void dispenser_eeprom__init - (DispenserEEprom *message); -size_t dispenser_eeprom__get_packed_size - (const DispenserEEprom *message); -size_t dispenser_eeprom__pack - (const DispenserEEprom *message, +/* DispenserEEpromInfo methods */ +void dispenser_eeprom_info__init + (DispenserEEpromInfo *message); +size_t dispenser_eeprom_info__get_packed_size + (const DispenserEEpromInfo *message); +size_t dispenser_eeprom_info__pack + (const DispenserEEpromInfo *message, uint8_t *out); -size_t dispenser_eeprom__pack_to_buffer - (const DispenserEEprom *message, +size_t dispenser_eeprom_info__pack_to_buffer + (const DispenserEEpromInfo *message, ProtobufCBuffer *buffer); -DispenserEEprom * - dispenser_eeprom__unpack +DispenserEEpromInfo * + dispenser_eeprom_info__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void dispenser_eeprom__free_unpacked - (DispenserEEprom *message, +void dispenser_eeprom_info__free_unpacked + (DispenserEEpromInfo *message, ProtobufCAllocator *allocator); /* --- per-message closures --- */ -typedef void (*DispenserEEprom_Closure) - (const DispenserEEprom *message, +typedef void (*DispenserEEpromInfo_Closure) + (const DispenserEEpromInfo *message, void *closure_data); /* --- services --- */ @@ -121,7 +121,7 @@ typedef void (*DispenserEEprom_Closure) /* --- descriptors --- */ -extern const ProtobufCMessageDescriptor dispenser_eeprom__descriptor; +extern const ProtobufCMessageDescriptor dispenser_eeprom_info__descriptor; PROTOBUF_C__END_DECLS diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEpromRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEpromRequest.pb-c.c index a86bfd0b1..8e98891a0 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEpromRequest.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEpromRequest.pb-c.c @@ -85,7 +85,7 @@ static const ProtobufCFieldDescriptor dispenser_eeprom_request__field_descriptor PROTOBUF_C_TYPE_MESSAGE, 0, /* quantifier_offset */ offsetof(DispenserEEpromRequest, dispensereeprom), - &dispenser_eeprom__descriptor, + &dispenser_eeprom_info__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEpromRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEpromRequest.pb-c.h index e7db7f73e..d0d2dda4f 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEpromRequest.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEpromRequest.pb-c.h @@ -14,7 +14,7 @@ PROTOBUF_C__BEGIN_DECLS # error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. #endif -#include "DispenserEEprom.pb-c.h" +#include "DispenserEEPROM.pb-c.h" typedef struct _DispenserEEpromRequest DispenserEEpromRequest; @@ -31,7 +31,7 @@ struct _DispenserEEpromRequest uint32_t dispenserid; protobuf_c_boolean has_burnrequest; protobuf_c_boolean burnrequest; - DispenserEEprom *dispensereeprom; + DispenserEEpromInfo *dispensereeprom; }; #define DISPENSER_EEPROM_REQUEST__INIT \ { PROTOBUF_C_MESSAGE_INIT (&dispenser_eeprom_request__descriptor) \ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEpromResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEpromResponse.pb-c.c index 71459129d..c86c01ad6 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEpromResponse.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEpromResponse.pb-c.c @@ -73,7 +73,7 @@ static const ProtobufCFieldDescriptor dispenser_eeprom_response__field_descripto PROTOBUF_C_TYPE_MESSAGE, 0, /* quantifier_offset */ offsetof(DispenserEEpromResponse, dispensereeprom), - &dispenser_eeprom__descriptor, + &dispenser_eeprom_info__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEpromResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEpromResponse.pb-c.h index b4e7f98b5..a9186f5ef 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEpromResponse.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DispenserEEpromResponse.pb-c.h @@ -29,7 +29,7 @@ struct _DispenserEEpromResponse ProtobufCMessage base; protobuf_c_boolean has_dispenserid; uint32_t dispenserid; - DispenserEEprom *dispensereeprom; + DispenserEEpromInfo *dispensereeprom; }; #define DISPENSER_EEPROM_RESPONSE__INIT \ { PROTOBUF_C_MESSAGE_INIT (&dispenser_eeprom_response__descriptor) \ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEPROM.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEPROM.pb-c.c new file mode 100644 index 000000000..88ef38caf --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEPROM.pb-c.c @@ -0,0 +1,495 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubDispenserEEPROM.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubDispenserEEPROM.pb-c.h" +void dispenser_eeprom_data__init + (DispenserEEpromData *message) +{ + static const DispenserEEpromData init_value = DISPENSER_EEPROM_DATA__INIT; + *message = init_value; +} +size_t dispenser_eeprom_data__get_packed_size + (const DispenserEEpromData *message) +{ + assert(message->base.descriptor == &dispenser_eeprom_data__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t dispenser_eeprom_data__pack + (const DispenserEEpromData *message, + uint8_t *out) +{ + assert(message->base.descriptor == &dispenser_eeprom_data__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t dispenser_eeprom_data__pack_to_buffer + (const DispenserEEpromData *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &dispenser_eeprom_data__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +DispenserEEpromData * + dispenser_eeprom_data__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (DispenserEEpromData *) + protobuf_c_message_unpack (&dispenser_eeprom_data__descriptor, + allocator, len, data); +} +void dispenser_eeprom_data__free_unpacked + (DispenserEEpromData *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &dispenser_eeprom_data__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor dispenser_eeprom_data__field_descriptors[32] = +{ + { + "", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromData, has_header), + offsetof(DispenserEEpromData, header), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromData, has_tablelength), + offsetof(DispenserEEpromData, tablelength), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromData, has_tableversion), + offsetof(DispenserEEpromData, tableversion), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(DispenserEEpromData, dispenserp_n), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(DispenserEEpromData, pcbs_n), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(DispenserEEpromData, pcbpartnumber), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(DispenserEEpromData, dispensers_n), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 8, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromData, has_minimalpressure), + offsetof(DispenserEEpromData, minimalpressure), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 9, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromData, has_maximalpressure), + offsetof(DispenserEEpromData, maximalpressure), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 10, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromData, has_minimalmv), + offsetof(DispenserEEpromData, minimalmv), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 11, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromData, has_maximalmv), + offsetof(DispenserEEpromData, maximalmv), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 12, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromData, has_totalcycles), + offsetof(DispenserEEpromData, totalcycles), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 13, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromData, has_bubblesize), + offsetof(DispenserEEpromData, bubblesize), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 14, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromData, has_avg_nl_stepvalue_1_4), + offsetof(DispenserEEpromData, avg_nl_stepvalue_1_4), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 15, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromData, has_avg_nl_stepvalue_2_4), + offsetof(DispenserEEpromData, avg_nl_stepvalue_2_4), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 16, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromData, has_avg_nl_stepvalue_3_4), + offsetof(DispenserEEpromData, avg_nl_stepvalue_3_4), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 17, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromData, has_avg_nl_stepvalue_4_4), + offsetof(DispenserEEpromData, avg_nl_stepvalue_4_4), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 18, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromData, has_sw_reserve), + offsetof(DispenserEEpromData, sw_reserve), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 19, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(DispenserEEpromData, has_spare1_pressure), + offsetof(DispenserEEpromData, spare1_pressure), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 20, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(DispenserEEpromData, has_spare2_pressure), + offsetof(DispenserEEpromData, spare2_pressure), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 21, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromData, has_motorpulsespercycle), + offsetof(DispenserEEpromData, motorpulsespercycle), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 22, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromData, has_color), + offsetof(DispenserEEpromData, color), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 23, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromData, has_pressureslope), + offsetof(DispenserEEpromData, pressureslope), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 24, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(DispenserEEpromData, productiondate), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 25, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromData, has_atslocation), + offsetof(DispenserEEpromData, atslocation), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 26, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromData, has_spare1), + offsetof(DispenserEEpromData, spare1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 27, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromData, has_spare2), + offsetof(DispenserEEpromData, spare2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 28, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromData, has_atschannel), + offsetof(DispenserEEpromData, atschannel), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 29, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(DispenserEEpromData, has_unitempty), + offsetof(DispenserEEpromData, unitempty), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 30, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(DispenserEEpromData, has_dryrunpass_fail), + offsetof(DispenserEEpromData, dryrunpass_fail), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 31, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(DispenserEEpromData, has_flowpass_fail), + offsetof(DispenserEEpromData, flowpass_fail), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 32, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DispenserEEpromData, has_checksum), + offsetof(DispenserEEpromData, checksum), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned dispenser_eeprom_data__field_indices_by_name[] = { + 27, /* field[27] = ATSChannel */ + 24, /* field[24] = ATSlocation */ + 13, /* field[13] = AVG_Nl_stepValue_1_4 */ + 14, /* field[14] = AVG_Nl_stepValue_2_4 */ + 15, /* field[15] = AVG_Nl_stepValue_3_4 */ + 16, /* field[16] = AVG_Nl_stepValue_4_4 */ + 12, /* field[12] = BubbleSize */ + 31, /* field[31] = CheckSum */ + 21, /* field[21] = Color */ + 3, /* field[3] = DispenserP_N */ + 6, /* field[6] = DispenserS_N */ + 29, /* field[29] = DryRunPass_Fail */ + 30, /* field[30] = FlowPass_Fail */ + 0, /* field[0] = Header */ + 10, /* field[10] = MaximalMV */ + 8, /* field[8] = MaximalPressure */ + 9, /* field[9] = MinimalMV */ + 7, /* field[7] = MinimalPressure */ + 20, /* field[20] = MotorPulsesPerCycle */ + 5, /* field[5] = PCBPartNumber */ + 4, /* field[4] = PCBS_N */ + 22, /* field[22] = PressureSlope */ + 23, /* field[23] = ProductionDate */ + 17, /* field[17] = SW_Reserve */ + 25, /* field[25] = Spare1 */ + 18, /* field[18] = Spare1_pressure */ + 26, /* field[26] = Spare2 */ + 19, /* field[19] = Spare2_pressure */ + 1, /* field[1] = TableLength */ + 2, /* field[2] = Tableversion */ + 11, /* field[11] = TotalCycles */ + 28, /* field[28] = UnitEmpty */ +}; +static const ProtobufCIntRange dispenser_eeprom_data__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 32 } +}; +const ProtobufCMessageDescriptor dispenser_eeprom_data__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(DispenserEEpromData), + 32, + dispenser_eeprom_data__field_descriptors, + dispenser_eeprom_data__field_indices_by_name, + 1, dispenser_eeprom_data__number_ranges, + (ProtobufCMessageInit) dispenser_eeprom_data__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEPROM.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEPROM.pb-c.h new file mode 100644 index 000000000..d07cd3006 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEPROM.pb-c.h @@ -0,0 +1,129 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubDispenserEEPROM.proto */ + +#ifndef PROTOBUF_C_StubDispenserEEPROM_2eproto__INCLUDED +#define PROTOBUF_C_StubDispenserEEPROM_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _DispenserEEpromData DispenserEEpromData; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _DispenserEEpromData +{ + ProtobufCMessage base; + protobuf_c_boolean has_header; + uint32_t header; + protobuf_c_boolean has_tablelength; + uint32_t tablelength; + protobuf_c_boolean has_tableversion; + uint32_t tableversion; + char *dispenserp_n; + char *pcbs_n; + char *pcbpartnumber; + char *dispensers_n; + protobuf_c_boolean has_minimalpressure; + uint32_t minimalpressure; + protobuf_c_boolean has_maximalpressure; + uint32_t maximalpressure; + protobuf_c_boolean has_minimalmv; + uint32_t minimalmv; + protobuf_c_boolean has_maximalmv; + uint32_t maximalmv; + protobuf_c_boolean has_totalcycles; + uint32_t totalcycles; + protobuf_c_boolean has_bubblesize; + uint32_t bubblesize; + protobuf_c_boolean has_avg_nl_stepvalue_1_4; + uint32_t avg_nl_stepvalue_1_4; + protobuf_c_boolean has_avg_nl_stepvalue_2_4; + uint32_t avg_nl_stepvalue_2_4; + protobuf_c_boolean has_avg_nl_stepvalue_3_4; + uint32_t avg_nl_stepvalue_3_4; + protobuf_c_boolean has_avg_nl_stepvalue_4_4; + uint32_t avg_nl_stepvalue_4_4; + protobuf_c_boolean has_sw_reserve; + uint32_t sw_reserve; + protobuf_c_boolean has_spare1_pressure; + int32_t spare1_pressure; + protobuf_c_boolean has_spare2_pressure; + int32_t spare2_pressure; + protobuf_c_boolean has_motorpulsespercycle; + uint32_t motorpulsespercycle; + protobuf_c_boolean has_color; + uint32_t color; + protobuf_c_boolean has_pressureslope; + uint32_t pressureslope; + char *productiondate; + protobuf_c_boolean has_atslocation; + uint32_t atslocation; + protobuf_c_boolean has_spare1; + uint32_t spare1; + protobuf_c_boolean has_spare2; + uint32_t spare2; + protobuf_c_boolean has_atschannel; + uint32_t atschannel; + protobuf_c_boolean has_unitempty; + protobuf_c_boolean unitempty; + protobuf_c_boolean has_dryrunpass_fail; + protobuf_c_boolean dryrunpass_fail; + protobuf_c_boolean has_flowpass_fail; + protobuf_c_boolean flowpass_fail; + protobuf_c_boolean has_checksum; + uint32_t checksum; +}; +#define DISPENSER_EEPROM_DATA__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&dispenser_eeprom_data__descriptor) \ + , 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + + +/* DispenserEEpromData methods */ +void dispenser_eeprom_data__init + (DispenserEEpromData *message); +size_t dispenser_eeprom_data__get_packed_size + (const DispenserEEpromData *message); +size_t dispenser_eeprom_data__pack + (const DispenserEEpromData *message, + uint8_t *out); +size_t dispenser_eeprom_data__pack_to_buffer + (const DispenserEEpromData *message, + ProtobufCBuffer *buffer); +DispenserEEpromData * + dispenser_eeprom_data__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void dispenser_eeprom_data__free_unpacked + (DispenserEEpromData *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*DispenserEEpromData_Closure) + (const DispenserEEpromData *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor dispenser_eeprom_data__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubDispenserEEPROM_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEpromRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEpromRequest.pb-c.c new file mode 100644 index 000000000..5abadc030 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEpromRequest.pb-c.c @@ -0,0 +1,118 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubDispenserEEpromRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubDispenserEEpromRequest.pb-c.h" +void stub_dispenser_eeprom_request__init + (StubDispenserEEpromRequest *message) +{ + static const StubDispenserEEpromRequest init_value = STUB_DISPENSER_EEPROM_REQUEST__INIT; + *message = init_value; +} +size_t stub_dispenser_eeprom_request__get_packed_size + (const StubDispenserEEpromRequest *message) +{ + assert(message->base.descriptor == &stub_dispenser_eeprom_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_dispenser_eeprom_request__pack + (const StubDispenserEEpromRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_dispenser_eeprom_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_dispenser_eeprom_request__pack_to_buffer + (const StubDispenserEEpromRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_dispenser_eeprom_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubDispenserEEpromRequest * + stub_dispenser_eeprom_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubDispenserEEpromRequest *) + protobuf_c_message_unpack (&stub_dispenser_eeprom_request__descriptor, + allocator, len, data); +} +void stub_dispenser_eeprom_request__free_unpacked + (StubDispenserEEpromRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_dispenser_eeprom_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_dispenser_eeprom_request__field_descriptors[3] = +{ + { + "", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubDispenserEEpromRequest, has_dispenserid), + offsetof(StubDispenserEEpromRequest, dispenserid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubDispenserEEpromRequest, has_burnrequest), + offsetof(StubDispenserEEpromRequest, burnrequest), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(StubDispenserEEpromRequest, dispensereeprom), + &dispenser_eeprom_data__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_dispenser_eeprom_request__field_indices_by_name[] = { + 1, /* field[1] = BurnRequest */ + 2, /* field[2] = DispenserEEprom */ + 0, /* field[0] = DispenserId */ +}; +static const ProtobufCIntRange stub_dispenser_eeprom_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor stub_dispenser_eeprom_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(StubDispenserEEpromRequest), + 3, + stub_dispenser_eeprom_request__field_descriptors, + stub_dispenser_eeprom_request__field_indices_by_name, + 1, stub_dispenser_eeprom_request__number_ranges, + (ProtobufCMessageInit) stub_dispenser_eeprom_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEpromRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEpromRequest.pb-c.h new file mode 100644 index 000000000..043ee459b --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEpromRequest.pb-c.h @@ -0,0 +1,76 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubDispenserEEpromRequest.proto */ + +#ifndef PROTOBUF_C_StubDispenserEEpromRequest_2eproto__INCLUDED +#define PROTOBUF_C_StubDispenserEEpromRequest_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "StubDispenserEEPROM.pb-c.h" + +typedef struct _StubDispenserEEpromRequest StubDispenserEEpromRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubDispenserEEpromRequest +{ + ProtobufCMessage base; + protobuf_c_boolean has_dispenserid; + uint32_t dispenserid; + protobuf_c_boolean has_burnrequest; + protobuf_c_boolean burnrequest; + DispenserEEpromData *dispensereeprom; +}; +#define STUB_DISPENSER_EEPROM_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_dispenser_eeprom_request__descriptor) \ + , 0, 0, 0, 0, NULL } + + +/* StubDispenserEEpromRequest methods */ +void stub_dispenser_eeprom_request__init + (StubDispenserEEpromRequest *message); +size_t stub_dispenser_eeprom_request__get_packed_size + (const StubDispenserEEpromRequest *message); +size_t stub_dispenser_eeprom_request__pack + (const StubDispenserEEpromRequest *message, + uint8_t *out); +size_t stub_dispenser_eeprom_request__pack_to_buffer + (const StubDispenserEEpromRequest *message, + ProtobufCBuffer *buffer); +StubDispenserEEpromRequest * + stub_dispenser_eeprom_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_dispenser_eeprom_request__free_unpacked + (StubDispenserEEpromRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubDispenserEEpromRequest_Closure) + (const StubDispenserEEpromRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_dispenser_eeprom_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubDispenserEEpromRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEpromResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEpromResponse.pb-c.c new file mode 100644 index 000000000..8400576fa --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEpromResponse.pb-c.c @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubDispenserEEpromResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubDispenserEEpromResponse.pb-c.h" +void stub_dispenser_eeprom_response__init + (StubDispenserEEpromResponse *message) +{ + static const StubDispenserEEpromResponse init_value = STUB_DISPENSER_EEPROM_RESPONSE__INIT; + *message = init_value; +} +size_t stub_dispenser_eeprom_response__get_packed_size + (const StubDispenserEEpromResponse *message) +{ + assert(message->base.descriptor == &stub_dispenser_eeprom_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_dispenser_eeprom_response__pack + (const StubDispenserEEpromResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_dispenser_eeprom_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_dispenser_eeprom_response__pack_to_buffer + (const StubDispenserEEpromResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_dispenser_eeprom_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubDispenserEEpromResponse * + stub_dispenser_eeprom_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubDispenserEEpromResponse *) + protobuf_c_message_unpack (&stub_dispenser_eeprom_response__descriptor, + allocator, len, data); +} +void stub_dispenser_eeprom_response__free_unpacked + (StubDispenserEEpromResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_dispenser_eeprom_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_dispenser_eeprom_response__field_descriptors[2] = +{ + { + "", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubDispenserEEpromResponse, has_dispenserid), + offsetof(StubDispenserEEpromResponse, dispenserid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(StubDispenserEEpromResponse, dispensereeprom), + &dispenser_eeprom_data__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_dispenser_eeprom_response__field_indices_by_name[] = { + 1, /* field[1] = DispenserEEprom */ + 0, /* field[0] = DispenserId */ +}; +static const ProtobufCIntRange stub_dispenser_eeprom_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor stub_dispenser_eeprom_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(StubDispenserEEpromResponse), + 2, + stub_dispenser_eeprom_response__field_descriptors, + stub_dispenser_eeprom_response__field_indices_by_name, + 1, stub_dispenser_eeprom_response__number_ranges, + (ProtobufCMessageInit) stub_dispenser_eeprom_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEpromResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEpromResponse.pb-c.h new file mode 100644 index 000000000..7529a41f0 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEpromResponse.pb-c.h @@ -0,0 +1,74 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubDispenserEEpromResponse.proto */ + +#ifndef PROTOBUF_C_StubDispenserEEpromResponse_2eproto__INCLUDED +#define PROTOBUF_C_StubDispenserEEpromResponse_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "StubDispenserEEprom.pb-c.h" + +typedef struct _StubDispenserEEpromResponse StubDispenserEEpromResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubDispenserEEpromResponse +{ + ProtobufCMessage base; + protobuf_c_boolean has_dispenserid; + uint32_t dispenserid; + DispenserEEpromData *dispensereeprom; +}; +#define STUB_DISPENSER_EEPROM_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_dispenser_eeprom_response__descriptor) \ + , 0, 0, NULL } + + +/* StubDispenserEEpromResponse methods */ +void stub_dispenser_eeprom_response__init + (StubDispenserEEpromResponse *message); +size_t stub_dispenser_eeprom_response__get_packed_size + (const StubDispenserEEpromResponse *message); +size_t stub_dispenser_eeprom_response__pack + (const StubDispenserEEpromResponse *message, + uint8_t *out); +size_t stub_dispenser_eeprom_response__pack_to_buffer + (const StubDispenserEEpromResponse *message, + ProtobufCBuffer *buffer); +StubDispenserEEpromResponse * + stub_dispenser_eeprom_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_dispenser_eeprom_response__free_unpacked + (StubDispenserEEpromResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubDispenserEEpromResponse_Closure) + (const StubDispenserEEpromResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_dispenser_eeprom_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubDispenserEEpromResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubWhsEEPROM.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubWhsEEPROM.pb-c.c new file mode 100644 index 000000000..919b17543 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubWhsEEPROM.pb-c.c @@ -0,0 +1,326 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubWhsEEPROM.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubWhsEEPROM.pb-c.h" +void whs_eeprom_data__init + (WhsEEpromData *message) +{ + static const WhsEEpromData init_value = WHS_EEPROM_DATA__INIT; + *message = init_value; +} +size_t whs_eeprom_data__get_packed_size + (const WhsEEpromData *message) +{ + assert(message->base.descriptor == &whs_eeprom_data__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t whs_eeprom_data__pack + (const WhsEEpromData *message, + uint8_t *out) +{ + assert(message->base.descriptor == &whs_eeprom_data__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t whs_eeprom_data__pack_to_buffer + (const WhsEEpromData *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &whs_eeprom_data__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +WhsEEpromData * + whs_eeprom_data__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (WhsEEpromData *) + protobuf_c_message_unpack (&whs_eeprom_data__descriptor, + allocator, len, data); +} +void whs_eeprom_data__free_unpacked + (WhsEEpromData *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &whs_eeprom_data__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor whs_eeprom_data__field_descriptors[19] = +{ + { + "", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(WhsEEpromData, has_header), + offsetof(WhsEEpromData, header), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(WhsEEpromData, has_tablelength), + offsetof(WhsEEpromData, tablelength), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(WhsEEpromData, has_tableversion), + offsetof(WhsEEpromData, tableversion), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(WhsEEpromData, whsp_n), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(WhsEEpromData, pcbs_n), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(WhsEEpromData, pcbpartnumber), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(WhsEEpromData, whss_n), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 8, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(WhsEEpromData, has_orifice1flow), + offsetof(WhsEEpromData, orifice1flow), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 9, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(WhsEEpromData, has_orifice1slope), + offsetof(WhsEEpromData, orifice1slope), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 10, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(WhsEEpromData, has_orifice2flow), + offsetof(WhsEEpromData, orifice2flow), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 11, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(WhsEEpromData, has_orifice2slope), + offsetof(WhsEEpromData, orifice2slope), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 12, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(WhsEEpromData, has_orifice3flow), + offsetof(WhsEEpromData, orifice3flow), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 13, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(WhsEEpromData, has_orifice3slope), + offsetof(WhsEEpromData, orifice3slope), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 14, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(WhsEEpromData, has_orificevalveflow), + offsetof(WhsEEpromData, orificevalveflow), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 15, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(WhsEEpromData, has_orificevalveslope), + offsetof(WhsEEpromData, orificevalveslope), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 16, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(WhsEEpromData, vocinstallationdate), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 17, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(WhsEEpromData, filterinstallationdate), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 18, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(WhsEEpromData, productiondate), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 19, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(WhsEEpromData, has_checksum), + offsetof(WhsEEpromData, checksum), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned whs_eeprom_data__field_indices_by_name[] = { + 18, /* field[18] = CheckSum */ + 16, /* field[16] = FilterInstallationDate */ + 0, /* field[0] = Header */ + 7, /* field[7] = Orifice1Flow */ + 8, /* field[8] = Orifice1Slope */ + 9, /* field[9] = Orifice2Flow */ + 10, /* field[10] = Orifice2Slope */ + 11, /* field[11] = Orifice3Flow */ + 12, /* field[12] = Orifice3Slope */ + 13, /* field[13] = OrificeValveFlow */ + 14, /* field[14] = OrificeValveSlope */ + 5, /* field[5] = PCBPartNumber */ + 4, /* field[4] = PCBS_N */ + 17, /* field[17] = ProductionDate */ + 1, /* field[1] = TableLength */ + 2, /* field[2] = Tableversion */ + 15, /* field[15] = VOCInstallationDate */ + 3, /* field[3] = WhsP_N */ + 6, /* field[6] = WhsS_N */ +}; +static const ProtobufCIntRange whs_eeprom_data__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 19 } +}; +const ProtobufCMessageDescriptor whs_eeprom_data__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(WhsEEpromData), + 19, + whs_eeprom_data__field_descriptors, + whs_eeprom_data__field_indices_by_name, + 1, whs_eeprom_data__number_ranges, + (ProtobufCMessageInit) whs_eeprom_data__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubWhsEEPROM.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubWhsEEPROM.pb-c.h new file mode 100644 index 000000000..a140ecf81 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubWhsEEPROM.pb-c.h @@ -0,0 +1,101 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubWhsEEPROM.proto */ + +#ifndef PROTOBUF_C_StubWhsEEPROM_2eproto__INCLUDED +#define PROTOBUF_C_StubWhsEEPROM_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _WhsEEpromData WhsEEpromData; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _WhsEEpromData +{ + ProtobufCMessage base; + protobuf_c_boolean has_header; + uint32_t header; + protobuf_c_boolean has_tablelength; + uint32_t tablelength; + protobuf_c_boolean has_tableversion; + uint32_t tableversion; + char *whsp_n; + char *pcbs_n; + char *pcbpartnumber; + char *whss_n; + protobuf_c_boolean has_orifice1flow; + double orifice1flow; + protobuf_c_boolean has_orifice1slope; + double orifice1slope; + protobuf_c_boolean has_orifice2flow; + double orifice2flow; + protobuf_c_boolean has_orifice2slope; + double orifice2slope; + protobuf_c_boolean has_orifice3flow; + double orifice3flow; + protobuf_c_boolean has_orifice3slope; + double orifice3slope; + protobuf_c_boolean has_orificevalveflow; + double orificevalveflow; + protobuf_c_boolean has_orificevalveslope; + double orificevalveslope; + char *vocinstallationdate; + char *filterinstallationdate; + char *productiondate; + protobuf_c_boolean has_checksum; + uint32_t checksum; +}; +#define WHS_EEPROM_DATA__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&whs_eeprom_data__descriptor) \ + , 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, 0, 0 } + + +/* WhsEEpromData methods */ +void whs_eeprom_data__init + (WhsEEpromData *message); +size_t whs_eeprom_data__get_packed_size + (const WhsEEpromData *message); +size_t whs_eeprom_data__pack + (const WhsEEpromData *message, + uint8_t *out); +size_t whs_eeprom_data__pack_to_buffer + (const WhsEEpromData *message, + ProtobufCBuffer *buffer); +WhsEEpromData * + whs_eeprom_data__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void whs_eeprom_data__free_unpacked + (WhsEEpromData *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*WhsEEpromData_Closure) + (const WhsEEpromData *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor whs_eeprom_data__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubWhsEEPROM_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubWhsEEpromRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubWhsEEpromRequest.pb-c.c new file mode 100644 index 000000000..9596486c7 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubWhsEEpromRequest.pb-c.c @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubWhsEEpromRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubWhsEEpromRequest.pb-c.h" +void whs_eeprom_request__init + (WhsEEpromRequest *message) +{ + static const WhsEEpromRequest init_value = WHS_EEPROM_REQUEST__INIT; + *message = init_value; +} +size_t whs_eeprom_request__get_packed_size + (const WhsEEpromRequest *message) +{ + assert(message->base.descriptor == &whs_eeprom_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t whs_eeprom_request__pack + (const WhsEEpromRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &whs_eeprom_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t whs_eeprom_request__pack_to_buffer + (const WhsEEpromRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &whs_eeprom_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +WhsEEpromRequest * + whs_eeprom_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (WhsEEpromRequest *) + protobuf_c_message_unpack (&whs_eeprom_request__descriptor, + allocator, len, data); +} +void whs_eeprom_request__free_unpacked + (WhsEEpromRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &whs_eeprom_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor whs_eeprom_request__field_descriptors[2] = +{ + { + "", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(WhsEEpromRequest, has_burnrequest), + offsetof(WhsEEpromRequest, burnrequest), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(WhsEEpromRequest, whseeprom), + &whs_eeprom_data__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned whs_eeprom_request__field_indices_by_name[] = { + 0, /* field[0] = BurnRequest */ + 1, /* field[1] = WhsEEprom */ +}; +static const ProtobufCIntRange whs_eeprom_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor whs_eeprom_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(WhsEEpromRequest), + 2, + whs_eeprom_request__field_descriptors, + whs_eeprom_request__field_indices_by_name, + 1, whs_eeprom_request__number_ranges, + (ProtobufCMessageInit) whs_eeprom_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubWhsEEpromRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubWhsEEpromRequest.pb-c.h new file mode 100644 index 000000000..a54021c93 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubWhsEEpromRequest.pb-c.h @@ -0,0 +1,74 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubWhsEEpromRequest.proto */ + +#ifndef PROTOBUF_C_StubWhsEEpromRequest_2eproto__INCLUDED +#define PROTOBUF_C_StubWhsEEpromRequest_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "StubWhsEEPROM.pb-c.h" + +typedef struct _WhsEEpromRequest WhsEEpromRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _WhsEEpromRequest +{ + ProtobufCMessage base; + protobuf_c_boolean has_burnrequest; + protobuf_c_boolean burnrequest; + WhsEEpromData *whseeprom; +}; +#define WHS_EEPROM_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&whs_eeprom_request__descriptor) \ + , 0, 0, NULL } + + +/* WhsEEpromRequest methods */ +void whs_eeprom_request__init + (WhsEEpromRequest *message); +size_t whs_eeprom_request__get_packed_size + (const WhsEEpromRequest *message); +size_t whs_eeprom_request__pack + (const WhsEEpromRequest *message, + uint8_t *out); +size_t whs_eeprom_request__pack_to_buffer + (const WhsEEpromRequest *message, + ProtobufCBuffer *buffer); +WhsEEpromRequest * + whs_eeprom_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void whs_eeprom_request__free_unpacked + (WhsEEpromRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*WhsEEpromRequest_Closure) + (const WhsEEpromRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor whs_eeprom_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubWhsEEpromRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubWhsEEpromResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubWhsEEpromResponse.pb-c.c new file mode 100644 index 000000000..85a138a6a --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubWhsEEpromResponse.pb-c.c @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubWhsEEpromResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubWhsEEpromResponse.pb-c.h" +void whs_eeprom_response__init + (WhsEEpromResponse *message) +{ + static const WhsEEpromResponse init_value = WHS_EEPROM_RESPONSE__INIT; + *message = init_value; +} +size_t whs_eeprom_response__get_packed_size + (const WhsEEpromResponse *message) +{ + assert(message->base.descriptor == &whs_eeprom_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t whs_eeprom_response__pack + (const WhsEEpromResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &whs_eeprom_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t whs_eeprom_response__pack_to_buffer + (const WhsEEpromResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &whs_eeprom_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +WhsEEpromResponse * + whs_eeprom_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (WhsEEpromResponse *) + protobuf_c_message_unpack (&whs_eeprom_response__descriptor, + allocator, len, data); +} +void whs_eeprom_response__free_unpacked + (WhsEEpromResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &whs_eeprom_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor whs_eeprom_response__field_descriptors[1] = +{ + { + "", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(WhsEEpromResponse, whseeprom), + &whs_eeprom_data__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned whs_eeprom_response__field_indices_by_name[] = { + 0, /* field[0] = WhsEEprom */ +}; +static const ProtobufCIntRange whs_eeprom_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor whs_eeprom_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(WhsEEpromResponse), + 1, + whs_eeprom_response__field_descriptors, + whs_eeprom_response__field_indices_by_name, + 1, whs_eeprom_response__number_ranges, + (ProtobufCMessageInit) whs_eeprom_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubWhsEEpromResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubWhsEEpromResponse.pb-c.h new file mode 100644 index 000000000..84c529277 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubWhsEEpromResponse.pb-c.h @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubWhsEEpromResponse.proto */ + +#ifndef PROTOBUF_C_StubWhsEEpromResponse_2eproto__INCLUDED +#define PROTOBUF_C_StubWhsEEpromResponse_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "StubWhsEEprom.pb-c.h" + +typedef struct _WhsEEpromResponse WhsEEpromResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _WhsEEpromResponse +{ + ProtobufCMessage base; + WhsEEpromData *whseeprom; +}; +#define WHS_EEPROM_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&whs_eeprom_response__descriptor) \ + , NULL } + + +/* WhsEEpromResponse methods */ +void whs_eeprom_response__init + (WhsEEpromResponse *message); +size_t whs_eeprom_response__get_packed_size + (const WhsEEpromResponse *message); +size_t whs_eeprom_response__pack + (const WhsEEpromResponse *message, + uint8_t *out); +size_t whs_eeprom_response__pack_to_buffer + (const WhsEEpromResponse *message, + ProtobufCBuffer *buffer); +WhsEEpromResponse * + whs_eeprom_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void whs_eeprom_response__free_unpacked + (WhsEEpromResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*WhsEEpromResponse_Closure) + (const WhsEEpromResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor whs_eeprom_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubWhsEEpromResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.c index 1fcbc92e1..65fee7d7f 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.c @@ -549,7 +549,7 @@ bool Get_Heaters_Current_Integer(HEATERS_CURRENT Heater_ID, int32_t* value ) //0 bool Get_Heaters_Current_float(HEATERS_CURRENT Heater_ID, double* value ) //0-8 //Shai add default value { if (Heater_ID>=NUM_OF_CURRENT_HEATERS) - return 0; + return ERROR; if (Heaters_Current_Read_Enable[Heater_ID] == false) return ERROR; // Heaters_Current[Heater_ID] else *value = Heaters_Current[Heater_ID]*100; diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.c index d374ca533..97e4311b6 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.c @@ -21,6 +21,9 @@ #include <drivers/FPGA/FPGA_Comm.h> #include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h" +#include "PMR/stubs/StubDispenserEEprom.pb-c.h" +#include "PMR/stubs/StubDispenserEEpromRequest.pb-c.h" +#include "PMR/stubs/StubDispenserEEpromResponse.pb-c.h" #include "PMR/Diagnostics/DispenserEEprom.pb-c.h" #include "PMR/Diagnostics/DispenserEEpromRequest.pb-c.h" #include "PMR/Diagnostics/DispenserEEpromResponse.pb-c.h" @@ -239,7 +242,7 @@ uint8_t Check_Dispenser_Type(uint8_t Dispenser_ID) return Dispenser_struct[Dispenser_ID].Status; } -uint32_t Get_EEPROM_DATA_From_Dispenser(int Dispenser_ID,DispenserEEprom *dispensereeprom) +uint32_t Get_EEPROM_DATA_From_Dispenser(int Dispenser_ID,DispenserEEpromData *dispensereeprom) { uint32_t status = OK; status |= I2C_EEprom_Set_for_Read_Ch(Dispenser_ID, 0xA0); @@ -320,7 +323,7 @@ uint32_t Get_EEPROM_DATA_From_Dispenser(int Dispenser_ID,DispenserEEprom *dispen } return status; } -uint32_t Prepare_EEPROM_DATA_For_Burning(int Dispenser_ID,DispenserEEprom *dispensereeprom) +uint32_t Prepare_EEPROM_DATA_For_Burning(int Dispenser_ID,DispenserEEpromData *dispensereeprom) { uint32_t status = OK; Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.Header = dispensereeprom->header; @@ -371,7 +374,7 @@ uint32_t DispenserEEpromRequestFunc(MessageContainer* requestContainer) MessageContainer responseContainer; uint32_t status = OK; - DispenserEEprom *DispenserEEpromInstance; + DispenserEEpromInfo *DispenserEEpromInstance; Report("DispenserEEpromRequestFunc",__FILE__,__LINE__,request->dispenserid,RpWarning,(int)request->burnrequest,0); if (request->burnrequest == true) @@ -380,10 +383,10 @@ uint32_t DispenserEEpromRequestFunc(MessageContainer* requestContainer) } else { - DispenserEEpromInstance = my_malloc(sizeof(DispenserEEprom)); + DispenserEEpromInstance = my_malloc(sizeof(DispenserEEpromInfo)); if (DispenserEEpromInstance) { - dispenser_eeprom__init(DispenserEEpromInstance); + dispenser_eeprom_info__init(DispenserEEpromInstance); status = Get_EEPROM_DATA_From_Dispenser(request->dispenserid,DispenserEEpromInstance); } else @@ -414,4 +417,54 @@ uint32_t DispenserEEpromRequestFunc(MessageContainer* requestContainer) return OK; } +uint32_t StubDispenserEEpromRequestFunc(MessageContainer* requestContainer) +{ + DispenserEEpromRequest *request = dispenser_eeprom_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + DispenserEEpromResponse Cresponse = DISPENSER_EEPROM_RESPONSE__INIT; + MessageContainer responseContainer; + + uint32_t status = OK; + DispenserEEpromData *DispenserEEpromInstance; + Report("StubDispenserEEpromRequestFunc",__FILE__,__LINE__,request->dispenserid,RpWarning,(int)request->burnrequest,0); + + if (request->burnrequest == true) + { + status = Prepare_EEPROM_DATA_For_Burning(request->dispenserid,request->dispensereeprom); + } + else + { + DispenserEEpromInstance = my_malloc(sizeof(DispenserEEpromData)); + if (DispenserEEpromInstance) + { + dispenser_eeprom_data__init(DispenserEEpromInstance); + status = Get_EEPROM_DATA_From_Dispenser(request->dispenserid,DispenserEEpromInstance); + } + else + { + status = FAILED; + LOG_ERROR(request->dispenserid,"my_malloc failed"); + } + } + if ((request->burnrequest == false) && (status == OK)) + { + Cresponse.dispensereeprom = DispenserEEpromInstance; + } + Cresponse.has_dispenserid = true; + Cresponse.dispenserid = request->dispenserid; + responseContainer = createContainer(MESSAGE_TYPE__StubDispenserEEpromResponse, requestContainer->token, true, &Cresponse, &dispenser_eeprom_response__pack, &dispenser_eeprom_response__get_packed_size); + responseContainer.continuous = false; + if (status != OK) + { + responseContainer.error = ERROR_CODE__INVALID_PARAMETER; + responseContainer.has_error = true; + } + uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + my_free(responseContainer.data.data); + if (DispenserEEpromInstance) + my_free(DispenserEEpromInstance); + SendChars((char*)container_buffer, container_size); + return OK; + +} diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.h index 3483e4033..5fae63651 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.h +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.h @@ -18,6 +18,7 @@ uint32_t test_disp_eeprom(uint8_t Dispenser_ID , uint8_t EEprom_Add); uint8_t Check_Dispenser_Type(); uint32_t DispenserEEpromRequestFunc(MessageContainer* requestContainer); +uint32_t StubDispenserEEpromRequestFunc(MessageContainer* requestContainer); #endif /* DRIVERS_I2C_COMMUNICATION_DISPENSERS_EEPROM_MUX_DISP_EEPROM_MUX_H_ */ diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c index b16994768..c12bec71b 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c @@ -44,6 +44,7 @@ typedef enum Actuators_Control, HeadFanControl, HeadMagnetAction, + HeadValveAction, /* enum for WHS :*/ WHS_start, @@ -171,6 +172,18 @@ void Trigger_Head_Magnet(int direction) Mailbox_post(I2C_ReadingMsgQ , &I2C_ReadingMessage, BIOS_NO_WAIT); return; } +void Trigger_Head_MixerValve(int direction) +{ + I2C_ReadingMessageStruc I2C_ReadingMessage; + //uint8_t Midtank_i; + + I2C_ReadingMessage.messageId = HeadValveAction; + I2C_ReadingMessage.parameter = direction; + if (I2C_ReadingMsgQ != NULL) + Mailbox_post(I2C_ReadingMsgQ , &I2C_ReadingMessage, BIOS_NO_WAIT); + return; +} + void Trigger_HeaterWriting(void) { I2C_ReadingMessageStruc I2C_ReadingMessage; @@ -511,6 +524,9 @@ void I2C_ReadingTask(UArg arg0, UArg arg1) else //DISABLE_MAGNET HeadCard_HeadMagnet_Disable(); break; + case HeadValveAction: + HeadCard_Valve_Control(I2C_ReadingMessage.parameter); + break; case Head_Inputs_Reading: Head_Read_IO_Reg(0x44, LOW_AND_HIGH);//BREAK__ZN1-12 + BREAK_HTIN Head_Read_IO_Reg(0x46, LOW_AND_HIGH);//READ HEAD CARD LS + ACT status + BREAK_HTOT diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h index 1af5ee0cd..d8f8e2273 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h @@ -47,5 +47,6 @@ void Trigger_Head_Actuators_Control(uint32_t Act_ID, bool Active_Low_Pwr, bool D void Trigger_Head_Fan_Control(uint32_t Fan_ID, uint16_t PWM); void Trigger_InputsReading(void); void Trigger_Head_Magnet(int direction); +void Trigger_Head_MixerValve(int direction); #endif /* DRIVERS_I2C_COMMUNICATION_I2C_TASK_H_ */ diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/EEPROM/WHS_EEPROM.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/EEPROM/WHS_EEPROM.c index 0832280c2..485a224f6 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/EEPROM/WHS_EEPROM.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/EEPROM/WHS_EEPROM.c @@ -12,6 +12,10 @@ #include "Drivers/I2C_Communication/WHS_Card/WHS_data.h" #include "driverlib/i2c.h" +#include "PMR/stubs/StubWhsEEprom.pb-c.h" +#include "PMR/stubs/StubWhsEEpromRequest.pb-c.h" +#include "PMR/stubs/StubWhsEEpromResponse.pb-c.h" + //EEPROM M24M01-DFMN6TP //uint32_t I2C_WHS_EEPROM_SLAVE_ADD = 0xA0; @@ -188,3 +192,180 @@ uint32_t Test_WHS_EEPROM() return status; } */ + +uint32_t Get_EEPROM_DATA_From_WHS(WhsEEpromData *Whseeprom) +{ + uint32_t status = OK; +/* status |= I2C_EEprom_Set_for_Read_Ch(Whs_ID, 0xA0); + status |= I2C_EEprom_Read_Ch(Whs_ID, 0xA0); + + if (status == OK) + { + Whseeprom->has_header = true; + Whseeprom->header = Whs_struct.Read_Disp_EEPROM.bytes.Header; + Whseeprom->has_tablelength = true; + Whseeprom->tablelength = Whs_struct.Read_Disp_EEPROM.bytes.Table_Length; + Whseeprom->has_tableversion = true; + Whseeprom->tableversion = Whs_struct.Read_Disp_EEPROM.bytes.Table_version; + Whseeprom->Whsp_n = my_malloc(sizeof(Whs_struct.Read_Disp_EEPROM.bytes.Whs_Part_Number)); + if (Whseeprom->Whsp_n) + memcpy(Whseeprom->Whsp_n,Whs_struct.Read_Disp_EEPROM.bytes.Whs_Part_Number,sizeof(Whs_struct.Read_Disp_EEPROM.bytes.Whs_Part_Number)); + Whseeprom->pcbs_n = my_malloc(sizeof(Whs_struct.Read_Disp_EEPROM.bytes.PCB_SN)); + if (Whseeprom->pcbs_n) + memcpy(Whseeprom->pcbs_n,Whs_struct.Read_Disp_EEPROM.bytes.PCB_SN,sizeof(Whs_struct.Read_Disp_EEPROM.bytes.PCB_SN)); + Whseeprom->pcbpartnumber = my_malloc(sizeof(Whs_struct.Read_Disp_EEPROM.bytes.PCB_Part_Number)); + if (Whseeprom->pcbpartnumber) + memcpy(Whseeprom->pcbpartnumber,Whs_struct.Read_Disp_EEPROM.bytes.PCB_Part_Number,sizeof(Whs_struct.Read_Disp_EEPROM.bytes.PCB_Part_Number)); + Whseeprom->Whss_n = my_malloc(sizeof(Whs_struct.Read_Disp_EEPROM.bytes.Whs_SN)); + if (Whseeprom->Whss_n) + memcpy(Whseeprom->Whss_n,Whs_struct.Read_Disp_EEPROM.bytes.Whs_SN,sizeof(Whs_struct.Read_Disp_EEPROM.bytes.Whs_SN)); + Whseeprom->has_minimalpressure = true; + Whseeprom->minimalpressure = Whs_struct.Read_Disp_EEPROM.bytes.Maximal_Pressure; + Whseeprom->has_maximalpressure = true; + Whseeprom->maximalpressure = Whs_struct.Read_Disp_EEPROM.bytes.Maximal_Pressure; + Whseeprom->has_minimalmv = true; + Whseeprom->minimalmv = Whs_struct.Read_Disp_EEPROM.bytes.Minimal_MV; + Whseeprom->has_maximalmv = true; + Whseeprom->maximalmv = Whs_struct.Read_Disp_EEPROM.bytes.Maximal_MV; + Whseeprom->has_totalcycles = true; + Whseeprom->totalcycles = Whs_struct.Read_Disp_EEPROM.bytes.Total_Cycles; + Whseeprom->has_bubblesize = true; + Whseeprom->bubblesize = Whs_struct.Read_Disp_EEPROM.bytes.Bubble_Size; + Whseeprom->has_avg_nl_stepvalue_1_4 = true; + Whseeprom->avg_nl_stepvalue_1_4 = Whs_struct.Read_Disp_EEPROM.bytes.AVG_Nl_Step_Value_1_4; + Whseeprom->has_avg_nl_stepvalue_2_4 = true; + Whseeprom->avg_nl_stepvalue_2_4 = Whs_struct.Read_Disp_EEPROM.bytes.AVG_Nl_Step_Value_2_4; + Whseeprom->has_avg_nl_stepvalue_3_4 = true; + Whseeprom->avg_nl_stepvalue_3_4 = Whs_struct.Read_Disp_EEPROM.bytes.AVG_Nl_Step_Value_3_4; + Whseeprom->has_avg_nl_stepvalue_4_4 = true; + Whseeprom->avg_nl_stepvalue_4_4 = Whs_struct.Read_Disp_EEPROM.bytes.AVG_Nl_Step_Value_4_4; + Whseeprom->has_sw_reserve = true; + Whseeprom->sw_reserve = Whs_struct.Read_Disp_EEPROM.bytes.SW_Reserve; + Whseeprom->has_spare1_pressure = true; + Whseeprom->spare1_pressure = Whs_struct.Read_Disp_EEPROM.bytes.Spare1_pressure; + Whseeprom->has_spare2_pressure = true; + Whseeprom->spare2_pressure = Whs_struct.Read_Disp_EEPROM.bytes.Spare2_pressure; + Whseeprom->has_motorpulsespercycle = true; + Whseeprom->motorpulsespercycle = Whs_struct.Read_Disp_EEPROM.bytes.Motor_PPC; + Whseeprom->has_color = true; + Whseeprom->color = Whs_struct.Read_Disp_EEPROM.bytes.color; + Whseeprom->has_pressureslope = true; + Whseeprom->pressureslope = Whs_struct.Read_Disp_EEPROM.bytes.Pressure_Slope; + Whseeprom->productiondate = my_malloc(sizeof(Whs_struct.Read_Disp_EEPROM.bytes.Production_Test_Date)+1); + if (Whseeprom->productiondate) + memcpy(Whseeprom->productiondate,Whs_struct.Read_Disp_EEPROM.bytes.Production_Test_Date,sizeof(Whs_struct.Read_Disp_EEPROM.bytes.Production_Test_Date)); + Whseeprom->has_atslocation = true; + Whseeprom->atslocation = Whs_struct.Read_Disp_EEPROM.bytes.ATS_Location; + Whseeprom->has_spare1 = true; + Whseeprom->spare1 = Whs_struct.Read_Disp_EEPROM.bytes.Spare1; + Whseeprom->has_spare2 = true; + Whseeprom->spare2 = Whs_struct.Read_Disp_EEPROM.bytes.Spare2; + Whseeprom->has_atschannel = true; + Whseeprom->atschannel = Whs_struct.Read_Disp_EEPROM.bytes.ATS_Channel; + Whseeprom->has_unitempty = true; + Whseeprom->unitempty = Whs_struct.Read_Disp_EEPROM.bytes.Unit_Empty; + Whseeprom->has_dryrunpass_fail = true; + Whseeprom->dryrunpass_fail = Whs_struct.Read_Disp_EEPROM.bytes.Dry_Run_Status; + Whseeprom->has_flowpass_fail = true; + Whseeprom->flowpass_fail = Whs_struct.Read_Disp_EEPROM.bytes.Flow_Status; + Whseeprom->has_checksum = true; + Whseeprom->checksum = Whs_struct.Read_Disp_EEPROM.bytes.CheckSum; + + } + */ + return status; +} +uint32_t Prepare_WHS_DATA_For_Burning(WhsEEpromData *Whseeprom) +{ + uint32_t status = OK; + /* + Whs_struct.Write_Disp_EEPROM.bytes.Header = Whseeprom->header; + Whs_struct.Write_Disp_EEPROM.bytes.Table_Length = Whseeprom->tablelength; + Whs_struct.Write_Disp_EEPROM.bytes.Table_version = Whseeprom->tableversion; + Whs_struct.Write_Disp_EEPROM.bytes.Maximal_Pressure = Whseeprom->minimalpressure; + Whs_struct.Write_Disp_EEPROM.bytes.Maximal_Pressure = Whseeprom->maximalpressure; + Whs_struct.Write_Disp_EEPROM.bytes.Minimal_MV = Whseeprom->minimalmv; + Whs_struct.Write_Disp_EEPROM.bytes.Maximal_MV = Whseeprom->maximalmv; + Whs_struct.Write_Disp_EEPROM.bytes.Total_Cycles = Whseeprom->totalcycles; + Whs_struct.Write_Disp_EEPROM.bytes.Bubble_Size = Whseeprom->bubblesize; + Whs_struct.Write_Disp_EEPROM.bytes.AVG_Nl_Step_Value_1_4 = Whseeprom->avg_nl_stepvalue_1_4; + Whs_struct.Write_Disp_EEPROM.bytes.AVG_Nl_Step_Value_2_4 = Whseeprom->avg_nl_stepvalue_2_4; + Whs_struct.Write_Disp_EEPROM.bytes.AVG_Nl_Step_Value_3_4 = Whseeprom->avg_nl_stepvalue_3_4; + Whs_struct.Write_Disp_EEPROM.bytes.AVG_Nl_Step_Value_4_4 = Whseeprom->avg_nl_stepvalue_4_4; + Whs_struct.Write_Disp_EEPROM.bytes.SW_Reserve = Whseeprom->sw_reserve; + Whs_struct.Write_Disp_EEPROM.bytes.Spare1_pressure = Whseeprom->spare1_pressure; + Whs_struct.Write_Disp_EEPROM.bytes.Spare2_pressure = Whseeprom->spare2_pressure; + Whs_struct.Write_Disp_EEPROM.bytes.Motor_PPC = Whseeprom->motorpulsespercycle; + Whs_struct.Write_Disp_EEPROM.bytes.color = Whseeprom->color; + Whs_struct.Write_Disp_EEPROM.bytes.Pressure_Slope = Whseeprom->pressureslope; + Whs_struct.Write_Disp_EEPROM.bytes.ATS_Location = Whseeprom->atslocation; + Whs_struct.Write_Disp_EEPROM.bytes.Spare1 = Whseeprom->spare1; + Whs_struct.Write_Disp_EEPROM.bytes.Spare2 = Whseeprom->spare2; + Whs_struct.Write_Disp_EEPROM.bytes.ATS_Channel = Whseeprom->atschannel; + Whs_struct.Write_Disp_EEPROM.bytes.Unit_Empty = Whseeprom->unitempty; + Whs_struct.Write_Disp_EEPROM.bytes.Dry_Run_Status = Whseeprom->dryrunpass_fail; + Whs_struct.Write_Disp_EEPROM.bytes.Flow_Status = Whseeprom->flowpass_fail; + Whs_struct.Write_Disp_EEPROM.bytes.CheckSum = Whseeprom->checksum; + if (Whseeprom->Whsp_n) + strncpy(Whs_struct.Write_Disp_EEPROM.bytes.Whs_Part_Number,Whseeprom->Whsp_n,sizeof(Whs_struct.Write_Disp_EEPROM.bytes.Whs_Part_Number)); + if (Whseeprom->pcbs_n) + strncpy(Whs_struct.Write_Disp_EEPROM.bytes.PCB_SN,Whseeprom->pcbs_n,sizeof(Whs_struct.Write_Disp_EEPROM.bytes.PCB_SN)); + if (Whseeprom->pcbpartnumber) + strncpy(Whs_struct.Write_Disp_EEPROM.bytes.PCB_Part_Number,Whseeprom->pcbpartnumber,sizeof(Whs_struct.Write_Disp_EEPROM.bytes.PCB_Part_Number)); + if (Whseeprom->Whss_n) + strncpy(Whs_struct.Write_Disp_EEPROM.bytes.Whs_SN,Whseeprom->Whss_n,sizeof(Whs_struct.Write_Disp_EEPROM.bytes.Whs_SN)); + if (Whseeprom->productiondate) + strncpy(Whs_struct.Write_Disp_EEPROM.bytes.Production_Test_Date,Whseeprom->productiondate,sizeof(Whs_struct.Write_Disp_EEPROM.bytes.Production_Test_Date)); + status = I2C_EEprom_Write_Ch(Whs_ID, 0xA0); + SysCtlDelay(5000000);//Must delay for at least 5 milli. !!! (See data sheet ) + */ + return status; +} +uint32_t WhsEEpromRequestFunc(MessageContainer* requestContainer) +{ + WhsEEpromRequest *request = whs_eeprom_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + WhsEEpromResponse Cresponse = WHS_EEPROM_RESPONSE__INIT; + MessageContainer responseContainer; + + uint32_t status = OK; + WhsEEpromData *WhsEEpromInstance; + Report("StubWhsEEpromRequestFunc",__FILE__,__LINE__,1,RpWarning,(int)request->burnrequest,0); + + if (request->burnrequest == true) + { + status = Prepare_WHS_DATA_For_Burning(request->whseeprom); + } + else + { + WhsEEpromInstance = my_malloc(sizeof(WhsEEpromData)); + if (WhsEEpromInstance) + { + whs_eeprom_data__init(WhsEEpromInstance); + status = Get_EEPROM_DATA_From_WHS(WhsEEpromInstance); + } + else + { + status = FAILED; + LOG_ERROR(1,"my_malloc failed"); + } + } + if ((request->burnrequest == false) && (status == OK)) + { + Cresponse.whseeprom = WhsEEpromInstance; + } + responseContainer = createContainer(MESSAGE_TYPE__StubWHSEEpromResponse, requestContainer->token, true, &Cresponse, &whs_eeprom_response__pack, &whs_eeprom_response__get_packed_size); + responseContainer.continuous = false; + if (status != OK) + { + responseContainer.error = ERROR_CODE__INVALID_PARAMETER; + responseContainer.has_error = true; + } + uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + my_free(responseContainer.data.data); + if (WhsEEpromInstance) + my_free(WhsEEpromInstance); + SendChars((char*)container_buffer, container_size); + return OK; + +} diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/EEPROM/WHS_EEPROM.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/EEPROM/WHS_EEPROM.h index 05a8ed95a..74ab0762b 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/EEPROM/WHS_EEPROM.h +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/EEPROM/WHS_EEPROM.h @@ -10,13 +10,30 @@ typedef struct { - uint8_t PCB_SN[20]; uint8_t Module_SN[20]; double Orifice_Pressure_V0[3]; // (measured orifice sensor voltage without flow) value for each orifice sensor double Orifice_Waste_Level_V0; // (measured orifice sensor voltage without flow) value for each orifice sensor double flow_calc_coefficient_C; // C (flow calculation coefficient) value (=0.239) - + uint32_t Header; + uint32_t Table_Length; + uint32_t Table_version; + uint8_t WHS_Part_Number[20];//String + // uint8_t PCB_SN[20];//String + uint8_t PCB_Part_Number[20];//String + uint8_t WHS_SN[20];//String + double Orifice1Flow; + double Orifice1Slope; + double Orifice2Flow; + double Orifice2Slope; + double Orifice3Flow; + double Orifice3Slope; + double OrificeValveFlow; + double OrificeValveSlope; + uint8_t VOCInstallationDate[8]; + uint8_t FilterInstallationDate[8]; + uint8_t ProductionDate[8]; + uint32_t CheckSum; }WHS_EEPROM_BYTES; typedef union @@ -63,4 +80,6 @@ uint32_t Check_WHS_Type_Via_EEPROM(); bool WHS_I2C_EEprom_Write_Byte(uint32_t address, uint8_t data); bool WHS_I2C_EEprom_Read_Byte (uint32_t address, uint8_t* p_data); +uint32_t DispenserEEpromRequestFunc(MessageContainer* requestContainer); + #endif /* DRIVERS_I2C_COMMUNICATION_WHS_CARD_EEPROM_WHS_EEPROM_H_ */ diff --git a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c index 0292815be..dce224d46 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c +++ b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c @@ -181,7 +181,7 @@ void Valve_Command(Valves_t Valve_Id) //1 - OPEN, 0 - CLOSE break; case VALVE_MIXCHIP_WASTECH: if(Head_Type > HEAD_TYPE_SYLKO_WITHOUT_CARD) - HeadCard_Valve_Control(ValveRequest[Valve_Id].Direction); + Trigger_Head_MixerValve(ValveRequest[Valve_Id].Direction); else F1_GPO_Reg.bits.F1_VALVE_MIXCHIP_WASTECH = ValveRequest[Valve_Id].Direction; break; diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index d31ea3c05..ab605bccb 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -767,8 +767,8 @@ uint32_t MillisecLowLoop(uint32_t tick) MotorGetStatusFromFPGA(Motor_i); }*/ midtankDisplay = 1-midtankDisplay; - if (WHS_Type == WHS_TYPE_UNKNOWN) - Gas_PPM_Info = Calculate_Gas_Power_Consumption(); + /*if (WHS_Type == WHS_TYPE_UNKNOWN) + Gas_PPM_Info = Calculate_Gas_Power_Consumption();*/ //Trigger_WHS_MAX11614_Read_allADC(); #ifdef CONTROL_DEBUG ResetControlTime(); diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c index 6c2db3da9..cbb9a34c3 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c @@ -24,6 +24,8 @@ #include <PMR/Diagnostics/MotorAbortHomingRequest.pb-c.h> #include <PMR/Diagnostics/MotorAbortHomingResponse.pb-c.h> +#include "Modules/Control/control.h" + #include "drivers/Motors/Motor.h" #include "drivers/Valves/Valve.h" #include "Drivers/I2C_Communication/DAC/blower.h" @@ -35,11 +37,41 @@ #include "StateMachines/Printing/PrintingSTM.h" char HomingToken[NUM_OF_MOTORS][36+1]={0}; +int HomingCounter[NUM_OF_MOTORS]; +uint32_t HomingControlId[NUM_OF_MOTORS]; /******************************************************************************** * Motor Homing ********************************************************************************/ //int32_t keepkvalright,keepkvalleft; +uint32_t MotorHomingProgressReport(uint32_t deviceID, uint32_t ReadValue) +{ + MessageContainer responseContainer; + MotorHomingResponse response = MOTOR_HOMING_RESPONSE__INIT; + bool last = false; + response.has_progress = true; + response.has_maxprogress = true; + response.maxprogress = 1000; + if (HomingCounter[deviceID]>=1000) + { + last = true; + SafeRemoveControlCallback(HomingControlId[deviceID],MotorHomingProgressReport); + Report("MotorHomingProgressReport stopped 1000",__FILE__,__LINE__,deviceID,RpMessage,HomingCounter[deviceID],0); + HomingControlId[deviceID] = 0xff; + } + response.progress = HomingCounter[deviceID]++; + Report("MotorHomingProgressReport",__FILE__,__LINE__,deviceID,RpMessage,HomingCounter[deviceID],0); + responseContainer = createContainer(MESSAGE_TYPE__MotorHomingResponse, HomingToken[deviceID], last, &response, &motor_homing_response__pack, &motor_homing_response__get_packed_size); + responseContainer.has_continuous = true; + responseContainer.continuous = true; + uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + my_free(responseContainer.data.data); + SendChars(container_buffer, container_size); + + return OK; + +} uint32_t MotorHomingRequestCallback(uint32_t deviceID, uint32_t ReadValue) { @@ -54,6 +86,12 @@ uint32_t MotorHomingRequestCallback(uint32_t deviceID, uint32_t ReadValue) { MotorSetKvalRun(HARDWARE_MOTOR_TYPE__MOTO_LLOADING, 24); } + if (HomingControlId[deviceID] != 0xff) + { + Report("MotorHomingProgressReport stopped",__FILE__,__LINE__,deviceID,RpMessage,HomingCounter[deviceID],0); + RemoveControlCallback(HomingControlId[deviceID],MotorHomingProgressReport); + HomingControlId[deviceID] = 0xff; + } responseContainer = createContainer(MESSAGE_TYPE__MotorHomingResponse, HomingToken[deviceID], true, &response, &motor_homing_response__pack, &motor_homing_response__get_packed_size); responseContainer.has_continuous = true; responseContainer.continuous = true; @@ -70,7 +108,7 @@ uint32_t MotorHomingRequestFunc(MessageContainer* requestContainer) { uint32_t numberOfSteps = 0; uint32_t LoadArmRounds = (int)dryerbufferlength; - + uint32_t status = FAILED; MessageContainer responseContainer; MotorHomingRequest* request = motor_homing_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); @@ -103,7 +141,7 @@ uint32_t MotorHomingRequestFunc(MessageContainer* requestContainer) } Report("MotorHomingRequestFunc Dryer lid open",__FILE__,MotorDriverResponse[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID].DriverType,DRIER_LID_OPEN,RpMessage,GPI_LS_DRYER_LID_OPEN,0); MotorGotoWithCallback(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID, direction, GPI_LS_DRYER_LID_OPEN, MotorHomingRequestCallback,4000); - return OK; + status = OK; } else { @@ -116,7 +154,7 @@ uint32_t MotorHomingRequestFunc(MessageContainer* requestContainer) //MotorMoveWithCallback(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, (1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize), // numberOfSteps, MotorHomingRequestCallback,1000); - return OK; + status = OK; } if ( Motor_Id_to_LS_IdDown[MotorId] != MAX_GPI) { @@ -131,7 +169,7 @@ uint32_t MotorHomingRequestFunc(MessageContainer* requestContainer) MotorSetKvalRun(HARDWARE_MOTOR_TYPE__MOTO_LLOADING, 70); } MotorMovetoLimitSwitch (MotorId,1-MotorsCfg[MotorId].directionthreadwize, speed, Motor_Id_to_LS_IdUp[MotorId], MotorHomingRequestCallback,30000); - return OK; + status = OK; } } @@ -150,7 +188,7 @@ uint32_t MotorHomingRequestFunc(MessageContainer* requestContainer) } Report("MotorHomingRequestFunc Dryer lid close",__FILE__,MotorDriverResponse[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID].DriverType,DRIER_LID_CLOSE,RpMessage,GPI_LS_DRYER_LID_CLOSED,0); MotorGotoWithCallback(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID, direction, GPI_LS_DRYER_LID_CLOSED, MotorHomingRequestCallback,4000); - return OK; + status = OK; } else { @@ -167,7 +205,7 @@ uint32_t MotorHomingRequestFunc(MessageContainer* requestContainer) MotorMoveWithCallback (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize, numberOfSteps, MotorHomingRequestCallback, 100000); - return OK; + status = OK; } if ( Motor_Id_to_LS_IdUp[MotorId] != MAX_GPI) { @@ -182,22 +220,31 @@ uint32_t MotorHomingRequestFunc(MessageContainer* requestContainer) MotorSetKvalRun(HARDWARE_MOTOR_TYPE__MOTO_LLOADING, 70); } MotorMovetoLimitSwitch (MotorId,MotorsCfg[MotorId].directionthreadwize, speed, Motor_Id_to_LS_IdDown[MotorId], MotorHomingRequestCallback,30000); - return OK; + status = OK; } } } } } - responseContainer.has_error = true; - responseContainer.error = ERROR_CODE__INVALID_PROCESS_ID; - responseContainer.errormessage = "Job Active or incorrect motor ID"; - responseContainer = createContainer(MESSAGE_TYPE__MotorHomingResponse, requestContainer->token, true, &response, &motor_homing_response__pack, &motor_homing_response__get_packed_size); - responseContainer.has_continuous = true; - responseContainer.continuous = true; - uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); - size_t container_size = message_container__pack(&responseContainer, container_buffer); - my_free(responseContainer.data.data); - SendChars(container_buffer, container_size); + if (status == OK) + { + HomingControlId[MotorId] = AddControlCallback(NULL, MotorHomingProgressReport, 2*eOneSecond, TemplateDataReadCBFunction,MotorId, 0, 0 ); + HomingCounter[MotorId] = 0; + Report("MotorHomingProgressReport started",__FILE__,__LINE__,MotorId,RpMessage,HomingControlId[MotorId],0); + } + else + { + responseContainer.has_error = true; + responseContainer.error = ERROR_CODE__INVALID_PROCESS_ID; + responseContainer.errormessage = "Job Active or incorrect motor ID"; + responseContainer = createContainer(MESSAGE_TYPE__MotorHomingResponse, requestContainer->token, true, &response, &motor_homing_response__pack, &motor_homing_response__get_packed_size); + responseContainer.has_continuous = true; + responseContainer.continuous = true; + uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + my_free(responseContainer.data.data); + SendChars(container_buffer, container_size); + } return OK; } @@ -212,6 +259,7 @@ uint32_t MotorAbortHomingRequestFunc(MessageContainer* requestContainer) TimerMotors_t MotorId = (TimerMotors_t)request->motortype; MotorAbortMovetoLimitSwitch(MotorId); + MotorHomingRequestCallback(MotorId,0); responseContainer = createContainer(MESSAGE_TYPE__MotorAbortHomingResponse, requestContainer->token, false, &response, &motor_abort_homing_response__pack, &motor_abort_homing_response__get_packed_size); responseContainer.continuous = false; @@ -226,18 +274,48 @@ return OK; /******************************************************************************** * Dispenser Homing ********************************************************************************/ +uint32_t DispenserHomingProgressReport(uint32_t deviceID, uint32_t ReadValue) +{ + MessageContainer responseContainer; + DispenserHomingResponse response = DISPENSER_HOMING_RESPONSE__INIT; + + bool last = false; + response.has_progress = true; + response.has_maxprogress = true; + response.maxprogress = 5800000; + response.progress = IDS_Dispenser_Data[deviceID].consumedinnanolitter; + uint8_t MotorId = deviceID+HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_1; + + responseContainer = createContainer(MESSAGE_TYPE__DispenserHomingResponse, HomingToken[MotorId], last, &response, &dispenser_homing_response__pack, &dispenser_homing_response__get_packed_size); + Report("DispenserHomingProgressReport",__FILE__,__LINE__,deviceID,RpMessage,IDS_Dispenser_Data[deviceID].consumedinnanolitter,0); + responseContainer.has_continuous = true; + responseContainer.continuous = true; + uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + my_free(responseContainer.data.data); + SendChars(container_buffer, container_size); + + return OK; + +} uint32_t DispenserHomingRequestCallback(uint32_t deviceID, uint32_t ReadValue) { MessageContainer responseContainer; - MotorHomingResponse response = MOTOR_HOMING_RESPONSE__INIT; + DispenserHomingResponse response = DISPENSER_HOMING_RESPONSE__INIT; uint8_t MotorId = deviceID+HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_1; + if (HomingControlId[MotorId] != 0xff) + { + RemoveControlCallback(HomingControlId[MotorId],DispenserHomingProgressReport); + HomingControlId[MotorId] = 0xff; + Report("DispenserHomingProgressReport stopped",__FILE__,__LINE__,deviceID,RpMessage,HomingControlId[MotorId],0); + } //close dry air valve in the dispenser //Valve_Set((Valves_t) (DispenserId+VALVE_2W_MID_AIR_8), Atm_MidTank_OFF); //MotorSetMicroStep(deviceID, MotorsCfg[deviceID].microstep); - responseContainer = createContainer(MESSAGE_TYPE__DispenserHomingResponse, HomingToken[MotorId], true, &response, &motor_homing_response__pack, &motor_homing_response__get_packed_size); + responseContainer = createContainer(MESSAGE_TYPE__DispenserHomingResponse, HomingToken[MotorId], true, &response, &dispenser_homing_response__pack, &dispenser_homing_response__get_packed_size); responseContainer.has_continuous = true; responseContainer.continuous = true; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); @@ -252,6 +330,8 @@ return OK; uint32_t DispenserHomingRequestFunc(MessageContainer* requestContainer) { + uint32_t status = OK; + MessageContainer responseContainer; DispenserHomingRequest* request = dispenser_homing_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); @@ -262,27 +342,37 @@ uint32_t DispenserHomingRequestFunc(MessageContainer* requestContainer) ustrncpy (HomingToken[MotorId], requestContainer->token,36); int speed = request->speed; - if (speed == 0) speed = 150; + if (speed == 0) speed = 500; responseContainer = createContainer(MESSAGE_TYPE__DispenserHomingResponse, requestContainer->token, false, &response, &dispenser_homing_response__pack, &dispenser_homing_response__get_packed_size); responseContainer.has_continuous = true; responseContainer.continuous = true; - uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); - size_t container_size = message_container__pack(&responseContainer, container_buffer); - my_free(responseContainer.data.data); - //USBCDCD_sendData(container_buffer, container_size,10); - SendChars(container_buffer, container_size); if (MotorId <= NUM_OF_MOTORS) { //if ((JobIsActive() == false)&&(isMotorConfigured(MotorId) == true)) if (isMotorConfigured(MotorId) == true) { if (request->direction == MOTOR_DIRECTION__Backward) //dispenser homing - IDS_HomeDispenser(request->index,speed,DispenserHomingRequestCallback); + status = IDS_HomeDispenser(request->index,speed,DispenserHomingRequestCallback); else //empty dispenser - - IDS_EmptyDispenser(request->index,speed,DispenserHomingRequestCallback);//return ERROR; + status = IDS_EmptyDispenser(request->index,speed,DispenserHomingRequestCallback);//return ERROR; + if (status == OK) + { + HomingControlId[MotorId] = AddControlCallback(NULL, DispenserHomingProgressReport, 2*eOneSecond, TemplateDataReadCBFunction,request->index, 0, 0 ); + Report("DispenserHomingProgressReport started",__FILE__,__LINE__,request->index,RpMessage,HomingControlId[MotorId],0); + } + } + else + { + responseContainer.error = ERROR_CODE__GENERAL_ERROR; + responseContainer.errormessage = "Invalid Id or dispenser not configured"; } } + uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + my_free(responseContainer.data.data); + //USBCDCD_sendData(container_buffer, container_size,10); + SendChars(container_buffer, container_size); return OK; } @@ -296,7 +386,15 @@ uint32_t DispenserAbortHomingRequestFunc(MessageContainer* requestContainer) DispenserAbortHomingResponse response = DISPENSER_ABORT_HOMING_RESPONSE__INIT; IDS_StopHomeDispenser(request->index); -/* + + TimerMotors_t MotorId = (request->index)+HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_1; + if (HomingControlId[MotorId] != 0xff) + { + RemoveControlCallback(HomingControlId[MotorId],DispenserHomingProgressReport); + HomingControlId[MotorId] = 0xff; + Report("DispenserHomingProgressReport stopped",__FILE__,__LINE__,request->index,RpMessage,HomingControlId[MotorId],0); + } + /* TimerMotors_t MotorId = (request->index)+HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_1; MotorAbortMovetoLimitSwitch(MotorId); //close dry air valve in the dispenser diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c index 1fe5968e6..2ffce8e46 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c @@ -284,13 +284,13 @@ uint32_t IDS_HomeDispenser (uint32_t DispenserId, uint32_t speed , callback_fptr { MotorMovetoLimitSwitch (MotorId,1-MotorsCfg[MotorId].directionthreadwize, speed/4, Dispenser_Id_to_LS_Id[DispenserId], IDS_HomeDispenserCallback,0); CurrentDispenserSpeed[DispenserId] = speed/4; - Report("IDS_HomeDispenser ",__FILE__,(int)midTankContent*1000,(int)DispenserId,RpWarning,speed/4,0); + Report("IDS_HomeDispenser ",__FILE__,(int)(midTankContent*1000),(int)DispenserId,RpWarning,speed/4,0); } else { MotorMovetoLimitSwitch (MotorId,1-MotorsCfg[MotorId].directionthreadwize, speed, Dispenser_Id_to_LS_Id[DispenserId], IDS_HomeDispenserCallback,0); CurrentDispenserSpeed[DispenserId] = speed; - Report("IDS_HomeDispenser ",__FILE__,(int)midTankContent*1000,(int)DispenserId,RpWarning,speed,0); + Report("IDS_HomeDispenser ",__FILE__,(int)(midTankContent*1000),(int)DispenserId,RpWarning,speed,0); } CurrentDispenserSpeed[DispenserId] = (-1*CurrentDispenserSpeed[DispenserId]); return OK; diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index 5be960d0f..5ca59a434 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -1383,6 +1383,7 @@ uint32_t IDSPreSegmentState(void *SegmentDetails, int SegmentId) uint32_t SegmentNumOfBrushStops = 0; double BrushStopTime = 0; uint32_t BrushStopCounter = 0; +uint32_t BrushStopStartTime = 0,BrushStopLength = 0; void IDS_StartBrushStop(int n_dispensers, JobDispenser** Dispensers) { @@ -1472,11 +1473,17 @@ uint32_t IDSBrushStopRestartCallback(uint32_t IfIndex, uint32_t readValue) int n_dispensers = 0; JobSegment* Segment = (void *)IfIndex; Task_Stat statbuf; + if(BrushStopStartTime+BrushStopLength+100 < msec_millisecondCounter ) + { + Report("!!!!!!!!!!!!Overtime!",__FILE__,msec_millisecondCounter,(int)BrushStopStartTime,RpWarning,(int)BrushStopLength,0); + } + if(BrushStopCounter++ < BrushStopTime) { return OK; } BrushStopCounter = 0; + BrushStopStartTime = msec_millisecondCounter; if (JobEndSequence == true) @@ -1553,7 +1560,7 @@ uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId) BrushStopTime = Segment->length*1000/(double)SegmentNumOfBrushStops; //brushstop in meters //brushstop in millisecond BrushStopTime = ((BrushStopTime*100)/dyeingspeed);//brushstop in seconds //BrushStopTime *= 1000; - Report("IDSSegmentState",__FILE__,__LINE__,(int)(BrushStopTime*1000),RpWarning,(int)SegmentNumOfBrushStops,0); + Report("IDSSegmentState bss time, num of bss",__FILE__,__LINE__,(int)(BrushStopTime),RpWarning,(int)SegmentNumOfBrushStops,0); if (uploadstrategy == JOB_UPLOAD_STRATEGY__Default) { Dispensers = Segment->brushstops[JobBrushStopId]->dispensers; @@ -1584,8 +1591,10 @@ uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId) JobBrushStopId++; if ((BrushStopTime)&&(SegmentNumOfBrushStops > 1)) { - BrushStopCounter = BrushStopTime+10; //move the IDS brush stop handling to highest priority in timing + BrushStopCounter = BrushStopTime+3; //move the IDS brush stop handling to highest priority in timing BrushStopControlId = AddControlCallback(NULL, IDSBrushStopRestartCallback, eOneMillisecond,TemplateDataReadCBFunction ,SegmentDetails, 0, 0 ); + BrushStopStartTime = msec_millisecondCounter; + BrushStopLength = BrushStopTime; if (BrushStopControlId == 0xFF) { Report("Add control callback failed",__FILE__,__LINE__,(int)BrushStopTime,RpWarning,(int)0,0); diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c index be91c17e6..869aac2c1 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -169,6 +169,7 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) //stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3EA, /*DisplayView =*/0x0000); // SetLeftDisplayView (HeadAVERAGE); SetWriteDisplayView(DrierAVERAGE); + SetDisplayView (AVERAGE); break; case 1: //stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3EA, /*DisplayView =*/0x1000); // @@ -184,6 +185,7 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) //stubManager.Run<ProgressResponse>("ProgressRequest" ,0x3EA, /*DisplayView =*/0x3000); // SetLeftDisplayView (HeadCURRENT); SetWriteDisplayView(DrierCURRENT); + SetDisplayView (CURRENT); break; } diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index 3b97e9eb7..9698f1ea3 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -59,7 +59,7 @@ uint32_t ScrewControlId = 0xFF; static bool KeepWindingCone = false; static uint32_t WindingConeLocation; -static uint32_t WinderBackToBaseTime = 800; +static uint32_t WinderBackToBaseTime = 1500; float NumberOfRotationPerPassage = 0.0; InternalWinderConfigStruc InternalWinderCfg = {0}; @@ -580,7 +580,8 @@ uint32_t Winder_End(void) ScrewsStopControlTimer(); //move the cart to the edge so the spool can be easily replaced //MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_SCREW,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize, 1000, GPI_LS_SCREW_RIGHT, NULL,0); - MotorStop(HARDWARE_MOTOR_TYPE__MOTO_SCREW,Hard_Hiz); + //MotorStop(HARDWARE_MOTOR_TYPE__MOTO_SCREW,Hard_Hiz); + MotorAbortMovetoLimitSwitch(HARDWARE_MOTOR_TYPE__MOTO_SCREW); //bug #2709 return OK; } void Winder_ScrewHomeLimitSwitchInterrupt(void) diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index 35d8c343d..bf0f55f90 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -847,6 +847,7 @@ void JobRequestFunc(MessageContainer* requestContainer) { n_segments = CurrentJob->n_segments; } + JobResumed = false; status = PASSED; JobEndReason = JOB_OK; TotalProcessedLength = 0.0; @@ -1336,6 +1337,7 @@ Void jobTask(UArg arg0, UArg arg1) break; case PrintingResultsOk: JobActive = false; + JobResumed = false; setmachineActive(false); SetMachineStatus(MACHINE_STATE__Ready); resetIdleCounter(); @@ -1350,6 +1352,7 @@ Void jobTask(UArg arg0, UArg arg1) break; case PrintingResultsFail: JobActive = false; + JobResumed = false; setmachineActive(false); //SetMachineStatus(MACHINE_STATE__Error); SetMachineStatus(MACHINE_STATE__Ready); diff --git a/Software/PMR/Messages/.settings/com.google.eclipse.protobuf.Protobuf.prefs b/Software/PMR/Messages/.settings/com.google.eclipse.protobuf.Protobuf.prefs index d6b53d3f2..d546a7cb3 100644 --- a/Software/PMR/Messages/.settings/com.google.eclipse.protobuf.Protobuf.prefs +++ b/Software/PMR/Messages/.settings/com.google.eclipse.protobuf.Protobuf.prefs @@ -1,4 +1,4 @@ eclipse.preferences.version=1 -paths.directoryPaths=${workspace_loc\:/${project}/Common},${workspace_loc\:/${project}/Jobs},${workspace_loc\:/${project}/Printing},${workspace_loc\:/${project}/ColorLab},${workspace_loc\:/${project}/Diagnostics},${workspace_loc\:/${project}/Debugging},${workspace_loc\:/${project}/Hardware},${workspace_loc\:/${project}/Embroidery},${workspace_loc\:/${project}/Connection},${workspace_loc\:/${project}/Integration},${workspace_loc\:/${project}/IO},${workspace_loc\:/${project}/Exports},${workspace_loc\:/${project}/FirmwareUpgrade},${workspace_loc\:/${project}/EmbeddedParameters},${workspace_loc\:/${project}/TCC},${workspace_loc\:/${project}/MachineStatus},${workspace_loc\:/${project}/Power},${workspace_loc\:/${project}/ThreadLoading},${workspace_loc\:/${project}/Printing} +paths.directoryPaths=${workspace_loc\:/${project}/Common},${workspace_loc\:/${project}/Jobs},${workspace_loc\:/${project}/Printing},${workspace_loc\:/${project}/ColorLab},${workspace_loc\:/${project}/Diagnostics},${workspace_loc\:/${project}/Debugging},${workspace_loc\:/${project}/Hardware},${workspace_loc\:/${project}/Embroidery},${workspace_loc\:/${project}/Connection},${workspace_loc\:/${project}/Integration},${workspace_loc\:/${project}/IO},${workspace_loc\:/${project}/Exports},${workspace_loc\:/${project}/FirmwareUpgrade},${workspace_loc\:/${project}/EmbeddedParameters},${workspace_loc\:/${project}/TCC},${workspace_loc\:/${project}/MachineStatus},${workspace_loc\:/${project}/Power},${workspace_loc\:/${project}/ThreadLoading},${workspace_loc\:/${project}/Printing},${workspace_loc\:/${project}/Stubs} paths.filesInMultipleDirectories=true paths.filesInOneDirectoryOnly=false diff --git a/Software/PMR/Messages/Common/MessageType.proto b/Software/PMR/Messages/Common/MessageType.proto index e6a45bbb8..f09042fea 100644 --- a/Software/PMR/Messages/Common/MessageType.proto +++ b/Software/PMR/Messages/Common/MessageType.proto @@ -115,6 +115,10 @@ enum MessageType StubAbortJobResponse = 102; StubMidTankPressureSensorRequest = 103; StubMidTankPressureSensorResponse = 104; + StubDispenserEEpromRequest = 105; + StubDispenserEEpromResponse = 106; + StubWHSEEpromRequest = 107; + StubWHSEEpromResponse = 108; //------------------------------------ @@ -188,8 +192,6 @@ enum MessageType StopCartridgesUpdateResponse = 2043; CartridgeValidationRequest = 2044; CartridgeValidationResponse = 2045; - DispenserEEpromRequest = 2046; - DispenserEEpromResponse = 2047; //Printing diff --git a/Software/PMR/Messages/Diagnostics/DispenserEEpromRequest.proto b/Software/PMR/Messages/Diagnostics/DispenserEEpromRequest.proto deleted file mode 100644 index 588efcf60..000000000 --- a/Software/PMR/Messages/Diagnostics/DispenserEEpromRequest.proto +++ /dev/null @@ -1,13 +0,0 @@ -syntax = "proto3"; - -import "DispenserEEprom.proto"; - -package Tango.PMR.Diagnostics; -option java_package = "com.twine.tango.pmr.diagnostics"; - -message DispenserEEpromRequest -{ - uint32 DispenserId = 1; - bool BurnRequest = 2; - DispenserEEprom DispenserEEprom = 3; -}
\ No newline at end of file diff --git a/Software/PMR/Messages/Diagnostics/DispenserEEpromResponse.proto b/Software/PMR/Messages/Diagnostics/DispenserEEpromResponse.proto deleted file mode 100644 index 815f92217..000000000 --- a/Software/PMR/Messages/Diagnostics/DispenserEEpromResponse.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; - -import "DispenserEEprom.proto"; - -package Tango.PMR.Diagnostics; -option java_package = "com.twine.tango.pmr.diagnostics"; - -message DispenserEEpromResponse -{ - uint32 DispenserId = 1; - DispenserEEprom DispenserEEprom = 2; -}
\ No newline at end of file diff --git a/Software/PMR/Messages/Diagnostics/DispenserEEPROM.proto b/Software/PMR/Messages/Stubs/StubDispenserEEPROM.proto index 056aaa08c..4c69cad3a 100644 --- a/Software/PMR/Messages/Diagnostics/DispenserEEPROM.proto +++ b/Software/PMR/Messages/Stubs/StubDispenserEEPROM.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package Tango.PMR.Diagnostics; -option java_package = "com.twine.tango.pmr.diagnostics"; +package Tango.PMR.Stubs; +option java_package = "com.twine.tango.pmr.stubs"; -message DispenserEEprom +message DispenserEEpromData { uint32 Header = 1; uint32 TableLength = 2; @@ -36,5 +36,5 @@ message DispenserEEprom bool UnitEmpty = 29; bool DryRunPass_Fail = 30; bool FlowPass_Fail = 31; - bool CheckSum = 32; + uint32 CheckSum = 32; }
\ No newline at end of file diff --git a/Software/PMR/Messages/Stubs/StubDispenserEEpromRequest.proto b/Software/PMR/Messages/Stubs/StubDispenserEEpromRequest.proto new file mode 100644 index 000000000..ddac0ff28 --- /dev/null +++ b/Software/PMR/Messages/Stubs/StubDispenserEEpromRequest.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +import "StubDispenserEEPROM.proto"; + +package Tango.PMR.Stubs; +option java_package = "com.twine.tango.pmr.stubs"; + +message StubDispenserEEpromRequest +{ + uint32 DispenserId = 1; + bool BurnRequest = 2; + DispenserEEpromData DispenserEEprom = 3; +}
\ No newline at end of file diff --git a/Software/PMR/Messages/Stubs/StubDispenserEEpromResponse.proto b/Software/PMR/Messages/Stubs/StubDispenserEEpromResponse.proto new file mode 100644 index 000000000..3d7c70657 --- /dev/null +++ b/Software/PMR/Messages/Stubs/StubDispenserEEpromResponse.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +import "StubDispenserEEprom.proto"; + +package Tango.PMR.Stubs; +option java_package = "com.twine.tango.pmr.stubs"; + +message StubDispenserEEpromResponse +{ + uint32 DispenserId = 1; + DispenserEEpromData DispenserEEprom = 2; +}
\ No newline at end of file diff --git a/Software/PMR/Messages/Stubs/StubWhsEEPROM.proto b/Software/PMR/Messages/Stubs/StubWhsEEPROM.proto new file mode 100644 index 000000000..0a90e5c73 --- /dev/null +++ b/Software/PMR/Messages/Stubs/StubWhsEEPROM.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; + +package Tango.PMR.Stubs; +option java_package = "com.twine.tango.pmr.stubs"; + +message WhsEEpromData +{ + uint32 Header = 1; + uint32 TableLength = 2; + uint32 Tableversion = 3; + string WhsP_N = 4; + string PCBS_N = 5; + string PCBPartNumber = 6; + string WhsS_N = 7; + double Orifice1Flow = 8; + double Orifice1Slope = 9; + double Orifice2Flow = 10; + double Orifice2Slope = 11; + double Orifice3Flow = 12; + double Orifice3Slope = 13; + double OrificeValveFlow = 14; + double OrificeValveSlope = 15; + string VOCInstallationDate = 16; + string FilterInstallationDate = 17; + string ProductionDate = 18; + uint32 CheckSum = 19; +}
\ No newline at end of file diff --git a/Software/PMR/Messages/Stubs/StubWhsEEpromRequest.proto b/Software/PMR/Messages/Stubs/StubWhsEEpromRequest.proto new file mode 100644 index 000000000..e0d9080d9 --- /dev/null +++ b/Software/PMR/Messages/Stubs/StubWhsEEpromRequest.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +import "StubWhsEEPROM.proto"; + +package Tango.PMR.Stubs; +option java_package = "com.twine.tango.pmr.stubs"; + +message WhsEEpromRequest +{ + bool BurnRequest = 1; + WhsEEpromData WhsEEprom = 2; +}
\ No newline at end of file diff --git a/Software/PMR/Messages/Stubs/StubWhsEEpromResponse.proto b/Software/PMR/Messages/Stubs/StubWhsEEpromResponse.proto new file mode 100644 index 000000000..12b6404ee --- /dev/null +++ b/Software/PMR/Messages/Stubs/StubWhsEEpromResponse.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + +import "StubWhsEEprom.proto"; + +package Tango.PMR.Stubs; +option java_package = "com.twine.tango.pmr.stubs"; + +message WhsEEpromResponse +{ + WhsEEpromData WhsEEprom = 1; +}
\ No newline at end of file diff --git a/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip b/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip index 2adf45797..19b86bbbc 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip +++ b/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip @@ -16,10 +16,10 @@ <ROW Property="ARPCOMMENTS" Value="This installer database contains the logic and data required to install [|ProductName]." ValueLocId="*"/> <ROW Property="ARPNOREPAIR" MultiBuildValue="DefaultBuild:1"/> <ROW Property="Manufacturer" Value="Twine"/> - <ROW Property="ProductCode" Value="1033:{A53E42EB-30CB-41C3-92A0-1AE5140164D7} " Type="16"/> + <ROW Property="ProductCode" Value="1033:{9D4EED8C-CE23-4990-A672-12783435B6A0} " Type="16"/> <ROW Property="ProductLanguage" Value="1033"/> <ROW Property="ProductName" Value="Machine Studio"/> - <ROW Property="ProductVersion" Value="4.1.8.0" Type="32"/> + <ROW Property="ProductVersion" Value="4.1.9.0" Type="32"/> <ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND;AI_SETUPEXEPATH;SETUPEXEDIR"/> <ROW Property="UpgradeCode" Value="{CBEE5CAE-7C5A-4280-98DE-AA98113764E4}"/> <ROW Property="WindowsType9X" MultiBuildValue="DefaultBuild:Windows 9x/ME" ValueLocId="-"/> @@ -817,7 +817,7 @@ <ROW Action="AI_DetectSoftware" Sequence="101"/> </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.BuildComponent"> - <ROW BuildKey="DefaultBuild" BuildName="DefaultBuild" BuildOrder="1" BuildType="0" PackageFolder="..\Build\Installers\Machine Studio\Release" PackageFileName="Machine Studio Installer_v4.0.9" Languages="en" InstallationType="4" CabsLocation="1" PackageType="1" FilesInsideExe="true" ExtractionFolder="[AppDataFolder][|Manufacturer]\[|ProductName] [|ProductVersion]\install" ExtUI="true" UseLargeSchema="true" ExeName="Machine Studio Installer_v4.1.8"/> + <ROW BuildKey="DefaultBuild" BuildName="DefaultBuild" BuildOrder="1" BuildType="0" PackageFolder="..\Build\Installers\Machine Studio\Release" PackageFileName="Machine Studio Installer_v4.0.9" Languages="en" InstallationType="4" CabsLocation="1" PackageType="1" FilesInsideExe="true" ExtractionFolder="[AppDataFolder][|Manufacturer]\[|ProductName] [|ProductVersion]\install" ExtUI="true" UseLargeSchema="true" ExeName="Machine Studio Installer_v4.1.9"/> </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.DictionaryComponent"> <ROW Path="<AI_DICTS>ui.ail"/> diff --git a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt Binary files differindex 9453b5c13..a603ff06b 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt +++ b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt diff --git a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip index 5bfc34cf9..743de5900 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip +++ b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip @@ -18,10 +18,10 @@ <ROW Property="ARPNOREPAIR" Value="1" MultiBuildValue="DefaultBuild:1"/> <ROW Property="ARPSYSTEMCOMPONENT" Value="1"/> <ROW Property="Manufacturer" Value="Twine"/> - <ROW Property="ProductCode" Value="1033:{C5CB0752-C04E-4799-A163-C1E81448D47B} " Type="16"/> + <ROW Property="ProductCode" Value="1033:{19CFF77D-D7DA-4A7A-8294-03465C33ABE4} " Type="16"/> <ROW Property="ProductLanguage" Value="1033"/> <ROW Property="ProductName" Value="Tango"/> - <ROW Property="ProductVersion" Value="1.1.12.0" Type="32"/> + <ROW Property="ProductVersion" Value="1.1.13.0" Type="32"/> <ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND;AI_SETUPEXEPATH;SETUPEXEDIR"/> <ROW Property="UpgradeCode" Value="{F8EAB8B4-FD57-45B7-8307-D52DF760273D}"/> <ROW Property="WindowsType9X" MultiBuildValue="DefaultBuild:Windows 9x/ME" ValueLocId="-"/> @@ -468,7 +468,7 @@ <ROW Action="AI_DetectSoftware" Sequence="101"/> </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.BuildComponent"> - <ROW BuildKey="DefaultBuild" BuildName="DefaultBuild" BuildOrder="1" BuildType="0" PackageFolder="..\Build\Installers\PPC" PackageFileName="PPC Installer v1.0.3" Languages="en" InstallationType="4" CabsLocation="1" PackageType="1" FilesInsideExe="true" ExtractionFolder="[AppDataFolder][|Manufacturer]\[|ProductName] [|ProductVersion]\install" ExtUI="true" UseLargeSchema="true" ExeName="PPC Installer_v1.1.12"/> + <ROW BuildKey="DefaultBuild" BuildName="DefaultBuild" BuildOrder="1" BuildType="0" PackageFolder="..\Build\Installers\PPC" PackageFileName="PPC Installer v1.0.3" Languages="en" InstallationType="4" CabsLocation="1" PackageType="1" FilesInsideExe="true" ExtractionFolder="[AppDataFolder][|Manufacturer]\[|ProductName] [|ProductVersion]\install" ExtUI="true" UseLargeSchema="true" ExeName="PPC Installer_v1.1.13"/> </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.DictionaryComponent"> <ROW Path="<AI_DICTS>ui.ail"/> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/Project/Widgets/RealTimeGraphWidgetView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/Project/Widgets/RealTimeGraphWidgetView.xaml index 7c6eb92d3..cd2735e2a 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/Project/Widgets/RealTimeGraphWidgetView.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/Project/Widgets/RealTimeGraphWidgetView.xaml @@ -8,6 +8,6 @@ mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=local:RealTimeGraphWidget,IsDesignTimeCreatable=False}"> <Grid> - <graphs:RealTimeGraph Controller="{Binding Controller}" /> + <graphs:RealTimeGraph HorizontalTicks="7" VerticalTicks="5" Controller="{Binding Controller}" /> </Grid> </UserControl> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ArrayParsingStyle.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ArrayParsingStyle.cs new file mode 100644 index 000000000..1380f6564 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ArrayParsingStyle.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.FSE.Stubs +{ + public enum ArrayParsingStyle + { + Comma, + SquareBrackets, + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Contracts/ITestDesignerView.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Contracts/ITestDesignerView.cs index 604d54571..97cf9a433 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Contracts/ITestDesignerView.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Contracts/ITestDesignerView.cs @@ -3,11 +3,14 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.FSE.Common; namespace Tango.FSE.Stubs.Contracts { - public interface ITestDesignerView + public interface ITestDesignerView : IFSEView { - + void FormatCode(); + void HighlightCode(int position, int length); + void InsertCode(String code); } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/CreateGroup.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/CreateGroup.cs new file mode 100644 index 000000000..de8de7107 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/CreateGroup.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; + +namespace Tango.FSE.Stubs +{ + public class CreateGroup : ExtendedObject + { + public String Name { get; set; } + + public List<CreateItem> Items { get; set; } + + public CreateGroup() + { + Items = new List<CreateItem>(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/CreateItem.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/CreateItem.cs new file mode 100644 index 000000000..be1d00df4 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/CreateItem.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; + +namespace Tango.FSE.Stubs +{ + public class CreateItem : ExtendedObject + { + public Type Type { get; set; } + + public String Name { get; set; } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/AddReferenceAssemblyViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/AddReferenceAssemblyViewVM.cs index aa32f6a03..cee06ed91 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/AddReferenceAssemblyViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/AddReferenceAssemblyViewVM.cs @@ -17,6 +17,8 @@ namespace Tango.FSE.Stubs.Dialogs { public class AddReferenceAssemblyViewVM : FSEDialogViewVM { + private List<ReferenceAssembly> _existing; + [TangoInject] private IFSEApplicationManager ApplicationManager { get; set; } @@ -24,42 +26,53 @@ namespace Tango.FSE.Stubs.Dialogs public AddReferenceAssemblyViewVM(List<ReferenceAssembly> existing) { + _existing = existing; OKText = "DONE"; - TangoIOC.Default.Inject(this); + } - List<ReferenceAssembly> source = new List<ReferenceAssembly>(); - - var startPath = ApplicationManager.StartPath; + public override void OnShow() + { + base.OnShow(); - foreach (var file in Directory.GetFiles(startPath, "*.dll")) + Task.Factory.StartNew(() => { - if (Path.GetFileName(file).StartsWith("Tango")) + System.Threading.Thread.Sleep(200); + List<ReferenceAssembly> source = new List<ReferenceAssembly>(); + + var startPath = ApplicationManager.StartPath; + + foreach (var file in Directory.GetFiles(startPath, "*.dll")) { - source.Add(ReferenceAssembly.FromFile(Path.GetFileName(file))); + if (Path.GetFileName(file).StartsWith("Tango")) + { + source.Add(ReferenceAssembly.FromFile(Path.GetFileName(file))); + } } - } - String dotNetPath = AssemblyHelper.GetAssemblyTargetFrameworkFolder(Assembly.GetExecutingAssembly()); + String dotNetPath = AssemblyHelper.GetAssemblyTargetFrameworkFolder(Assembly.GetExecutingAssembly()); - foreach (var file in Directory.GetFiles(dotNetPath, "*.dll")) - { - source.Add(ReferenceAssembly.FromFile(Path.GetFileName(file))); - } + foreach (var file in Directory.GetFiles(dotNetPath, "*.dll")) + { + source.Add(ReferenceAssembly.FromFile(Path.GetFileName(file))); + } - source = source.DistinctBy(x => x.Name).ToList(); + source = source.DistinctBy(x => x.Name).ToList(); - List<ReferenceAssembly> existingReferences = new List<ReferenceAssembly>(); + List<ReferenceAssembly> existingReferences = new List<ReferenceAssembly>(); - foreach (var asm in source) - { - if (existing.Exists(x => x.Name == asm.Name)) + foreach (var asm in source) { - existingReferences.Add(asm); + if (_existing.Exists(x => x.Name == asm.Name)) + { + existingReferences.Add(asm); + } } - } - ReferenceAssemblies = new SelectedObjectCollection<ReferenceAssembly>(source.ToObservableCollection(), existingReferences.ToObservableCollection()); + ReferenceAssemblies = new SelectedObjectCollection<ReferenceAssembly>(source.ToObservableCollection(), existingReferences.ToObservableCollection()); + + RaisePropertyChanged(nameof(ReferenceAssemblies)); + }); } } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/LoadPublishedProjectView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/LoadPublishedProjectView.xaml new file mode 100644 index 000000000..2289196e7 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/LoadPublishedProjectView.xaml @@ -0,0 +1,61 @@ +<UserControl x:Class="Tango.FSE.Stubs.Dialogs.LoadPublishedProjectView" + 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:material="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:local="clr-namespace:Tango.FSE.Stubs.Dialogs" + mc:Ignorable="d" + Width="1000" Height="600" d:DataContext="{d:DesignInstance Type=local:LoadPublishedProjectViewVM, IsDesignTimeCreatable=False}" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> + <Grid Margin="10"> + <DockPanel> + <StackPanel DockPanel.Dock="Top" Orientation="Horizontal"> + <material:PackIcon Kind="FolderCog" Width="32" Height="32" /> + <TextBlock Margin="10 0 0 0" FontSize="{StaticResource FSE_LargeFontSize}" VerticalAlignment="Center">Published Projects</TextBlock> + </StackPanel> + + <Border Margin="0 20 0 0" BorderThickness="1" BorderBrush="{StaticResource FSE_BorderBrush}" Background="{StaticResource FSE_PrimaryBackgroundDarkBrush}" CornerRadius="5"> + <ListBox FontSize="{StaticResource FSE_SmallFontSize}" Margin="2" Background="Transparent" HorizontalContentAlignment="Stretch" ItemsSource="{Binding PublishedTestProjects}" SelectedItem="{Binding SelectedProject}"> + <ListBox.ItemTemplate> + <DataTemplate> + <DockPanel> + <Image Source="../Images/project.png" RenderOptions.BitmapScalingMode="Fant" Width="64" /> + <material:PackIcon DockPanel.Dock="Right" Kind="Eye"> + <material:PackIcon.Style> + <Style TargetType="material:PackIcon"> + <Setter Property="Foreground" Value="{StaticResource FSE_GrayBrush}"></Setter> + <Setter Property="ToolTip" Value="Suppressed"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsVisible}" Value="True"> + <Setter Property="Foreground" Value="{StaticResource FSE_GreenBrush}"></Setter> + <Setter Property="ToolTip" Value="Published"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </material:PackIcon.Style> + </material:PackIcon> + <StackPanel Margin="10 0 0 0"> + <TextBlock FontSize="{StaticResource FSE_LargeFontSize}"> + <Run Text="{Binding Name}"></Run> + </TextBlock> + <TextBlock Margin="0 2 0 0" Foreground="{StaticResource FSE_GrayBrush}"> + <Run FontWeight="SemiBold">Version:</Run> + <Run Text="{Binding CurrentVersion.Version}"></Run> + </TextBlock> + <TextBlock Margin="0 2 0 0" Foreground="{StaticResource FSE_GrayBrush}"> + <Run FontWeight="SemiBold">Author:</Run> + <Run Text="{Binding CurrentVersion.Author}"></Run> + </TextBlock> + <TextBlock Margin="0 2 0 0" TextWrapping="NoWrap" Foreground="{StaticResource FSE_GrayBrush}" TextTrimming="CharacterEllipsis"> + <Run FontWeight="SemiBold">Description:</Run> + <Run Text="{Binding Description}"></Run> + </TextBlock> + </StackPanel> + </DockPanel> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + </Border> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/LoadPublishedProjectView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/LoadPublishedProjectView.xaml.cs new file mode 100644 index 000000000..9ea4798d5 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/LoadPublishedProjectView.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.FSE.Stubs.Dialogs +{ + /// <summary> + /// Interaction logic for LoadPublishedProjectView.xaml + /// </summary> + public partial class LoadPublishedProjectView : UserControl + { + public LoadPublishedProjectView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/LoadPublishedProjectViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/LoadPublishedProjectViewVM.cs new file mode 100644 index 000000000..5164e3262 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/LoadPublishedProjectViewVM.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.FSE.Common; + +namespace Tango.FSE.Stubs.Dialogs +{ + public class LoadPublishedProjectViewVM : FSEDialogViewVM + { + public List<PublishedTestProject> PublishedTestProjects { get; set; } + + private PublishedTestProject _selectedProject; + public PublishedTestProject SelectedProject + { + get { return _selectedProject; } + set { _selectedProject = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + + public LoadPublishedProjectViewVM(List<PublishedTestProject> projects) + { + OKText = "LOAD PROJECT"; + PublishedTestProjects = projects; + } + + protected override bool CanOK() + { + return base.CanOK() && SelectedProject != null; + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/UserInputDialogView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/UserInputDialogView.xaml new file mode 100644 index 000000000..755fa0b65 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/UserInputDialogView.xaml @@ -0,0 +1,39 @@ +<UserControl x:Class="Tango.FSE.Stubs.Dialogs.UserInputDialogView" + 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:material="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:local="clr-namespace:Tango.FSE.Stubs.Dialogs" + mc:Ignorable="d" + Width="500" Height="Auto" MaxHeight="500" d:DataContext="{d:DesignInstance Type=local:UserInputDialogViewVM, IsDesignTimeCreatable=False}" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> + <Grid Margin="10"> + <DockPanel> + <StackPanel DockPanel.Dock="Top" > + <StackPanel Orientation="Horizontal"> + <material:PackIcon Kind="EventEdit" Width="32" Height="32" /> + <TextBlock Margin="10 0 0 0" FontSize="{StaticResource FSE_LargeFontSize}" VerticalAlignment="Center" Text="{Binding Title}"></TextBlock> + </StackPanel> + <TextBlock Margin="42 0 40 0" TextWrapping="Wrap" Text="{Binding Message}" FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}"></TextBlock> + </StackPanel> + + <Border Margin="0 20 0 0" > + <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Padding="10"> + <ItemsControl ItemsSource="{Binding Parameters}"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <DockPanel Margin="0 10"> + <material:PackIcon Kind="Pen" /> + <StackPanel Margin="10 0 0 0"> + <TextBlock Margin="2 0 0 0" FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}" Text="{Binding Name}"></TextBlock> + <TextBox Padding="5" Margin="0 2 0 0" Style="{StaticResource FSE_Rounded_Corners_TextBox}" Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBox> + </StackPanel> + </DockPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </ScrollViewer> + </Border> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/UserInputDialogView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/UserInputDialogView.xaml.cs new file mode 100644 index 000000000..d25c86ccd --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/UserInputDialogView.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.FSE.Stubs.Dialogs +{ + /// <summary> + /// Interaction logic for UserInputDialogView.xaml + /// </summary> + public partial class UserInputDialogView : UserControl + { + public UserInputDialogView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/UserInputDialogViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/UserInputDialogViewVM.cs new file mode 100644 index 000000000..2160aa417 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/UserInputDialogViewVM.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; +using Tango.FSE.Common; + +namespace Tango.FSE.Stubs.Dialogs +{ + public class UserInputDialogViewVM : FSEDialogViewVM + { + public class Parameter + { + public PropertyInfo PropertyInfo { get; set; } + public FieldInfo FieldInfo { get; set; } + public String Name { get; set; } + public String Value { get; set; } + } + + public String Title { get; set; } + public String Message { get; set; } + public List<Parameter> Parameters { get; set; } + public Object Model { get; set; } + + public UserInputDialogViewVM(String title, String message, Object model) + { + CanClose = false; + Title = title; + Message = message; + Parameters = new List<Parameter>(); + Model = model; + } + + public void Init() + { + try + { + foreach (var prop in Model.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public)) + { + var att = prop.GetCustomAttribute<UserInput>(); + + Parameter p = new Parameter(); + p.PropertyInfo = prop; + p.Name = att != null ? att.Name : prop.Name.ToTitle(); + p.Value = prop.GetValue(Model).ToStringSafe(); + Parameters.Add(p); + } + + foreach (var field in Model.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public)) + { + var att = field.GetCustomAttribute<UserInput>(); + + Parameter p = new Parameter(); + p.FieldInfo = field; + p.Name = att != null ? att.Name : field.Name.ToTitle(); + p.Value = field.GetValue(Model).ToStringSafe(); + Parameters.Add(p); + } + } + catch (Exception ex) + { + throw new Exception("Error initializing the user input model.", ex); + } + } + + public void FinalizeModel() + { + foreach (var p in Parameters) + { + if (p.PropertyInfo != null) + { + try + { + p.PropertyInfo.SetValue(Model, Convert.ChangeType(p.Value, p.PropertyInfo.PropertyType)); + } + catch (Exception ex) + { + throw new ArgumentException($"Error setting the value '{p.Value}' for parameter '{p.PropertyInfo.Name}' of type '{p.PropertyInfo.PropertyType.Name}'.", ex); + } + } + else + { + try + { + p.FieldInfo.SetValue(Model, Convert.ChangeType(p.Value, p.FieldInfo.FieldType)); + } + catch (Exception ex) + { + throw new ArgumentException($"Error setting the value '{p.Value}' for parameter '{p.FieldInfo.Name}' of type '{p.FieldInfo.FieldType.Name}'.", ex); + } + } + } + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ITestContext.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ITestContext.cs index 9b8eb6f06..fc3344fa8 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ITestContext.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ITestContext.cs @@ -1,5 +1,6 @@ using Google.Protobuf; using System; +using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; @@ -17,18 +18,30 @@ namespace Tango.FSE.Stubs Result AddResult(Result result); void RemoveResult(Result result); void ClearResults(); - IMessage Run(String stubName, params Object[] args); - T Run<T>(String stubName, params Object[] args) where T : class, IMessage; - IMessage Run(IMessage stub); - T Run<T>(IMessage stub) where T : class, IMessage; - void RunContinuous<T>(T stub, Action<T> callback) where T : class, IMessage; - void RunContinuous<T>(String stubName, Action<T> callback, params Object[] args) where T : class, IMessage; + IMessage Run(String messageName, int? timeout = null, params Object[] args); + T Run<T>(String messageName, int? timeout = null, params Object[] args) where T : class, IMessage; + IMessage Run(IMessage message, int? timeout = null); + T Run<T>(IMessage message, int? timeout = null) where T : class, IMessage; + void RunContinuous<T>(IMessage message, Action<T> callback, int? timeout) where T : class, IMessage; + void RunContinuous<T>(String messageName, Action<T> callback, int? timeout, params Object[] args) where T : class, IMessage; void WriteLine(Object obj); void Write(Object obj); void WriteLineHex(Object number, int digits); void WriteHex(Object number, int digits); + void WriteLineArray(IEnumerable array, ArrayParsingStyle style); void Clear(); void WriteToFile(String filePath, String content); void AppendToFile(String filePath, String content); + T GetInput<T>(String key); + List<T> GetInputArray<T>(String key); + Object GetInput(String key); + void Fail(String message); + void ShowInfo(String message); + void ShowWarning(String message); + void ShowError(String message); + bool ShowQuestion(String message); + bool ShowWarningQuestion(String message); + T RequestUserInputFor<T>(String title, String message); + T RequestUserInputFor<T>(T model, String title, String message); } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Images/project.png b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Images/project.png Binary files differnew file mode 100644 index 000000000..a006b5ed5 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Images/project.png diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Images/project_small.png b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Images/project_small.png Binary files differnew file mode 100644 index 000000000..480e53758 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Images/project_small.png diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Images/test_tools.png b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Images/test_tools.png Binary files differnew file mode 100644 index 000000000..a6250add9 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Images/test_tools.png diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Messages/TestProjectPublished.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Messages/TestProjectPublished.cs new file mode 100644 index 000000000..5895531af --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Messages/TestProjectPublished.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.FSE.Stubs.Messages +{ + public class TestProjectPublishedOrSuppressed + { + + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ProjectRunner.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ProjectRunner.cs index 978455ff8..8e683b0f7 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ProjectRunner.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ProjectRunner.cs @@ -63,6 +63,12 @@ namespace Tango.FSE.Stubs try { State = ProjectRunnerState.Compiling; + + if (Project.Inputs.GroupBy(x => x.Key).Any(x => x.Count() > 1)) + { + throw new InvalidOperationException("Project inputs contain duplicate keys."); + } + var result = await Project.Compile(); State = ProjectRunnerState.None; return result; diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Resources/lib_template.csx b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Resources/lib_template.csx index f3fd6b36a..52ec531e7 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Resources/lib_template.csx +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Resources/lib_template.csx @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; using Tango.FSE.Stubs; -public class NewLibrary +public class @LibraryName { public double Calc(double a, double b) { diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Result.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Result.cs index 74f95a437..813f31532 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Result.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Result.cs @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; @@ -13,6 +14,11 @@ namespace Tango.FSE.Stubs public String Name { get; set; } public Object Value { get; set; } + internal bool IsValueArray + { + get { return Value != null && typeof(IEnumerable).IsAssignableFrom(Value.GetType()) && Value.GetType() != typeof(String); } + } + public Result() { diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Tango.FSE.Stubs.csproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Tango.FSE.Stubs.csproj index d80488f27..67bd5dfc8 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Tango.FSE.Stubs.csproj +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Tango.FSE.Stubs.csproj @@ -96,21 +96,36 @@ <Reference Include="PresentationFramework" /> </ItemGroup> <ItemGroup> + <Compile Include="ArrayParsingStyle.cs" /> <Compile Include="Contracts\ITestDesignerView.cs" /> + <Compile Include="CreateGroup.cs" /> + <Compile Include="CreateItem.cs" /> <Compile Include="Designer\ProjectModel.cs" /> <Compile Include="Designer\ScriptTabModel.cs" /> <Compile Include="Dialogs\AddReferenceAssemblyView.xaml.cs"> <DependentUpon>AddReferenceAssemblyView.xaml</DependentUpon> </Compile> <Compile Include="Dialogs\AddReferenceAssemblyViewVM.cs" /> + <Compile Include="Dialogs\LoadPublishedProjectView.xaml.cs"> + <DependentUpon>LoadPublishedProjectView.xaml</DependentUpon> + </Compile> + <Compile Include="Dialogs\LoadPublishedProjectViewVM.cs" /> + <Compile Include="Dialogs\UserInputDialogView.xaml.cs"> + <DependentUpon>UserInputDialogView.xaml</DependentUpon> + </Compile> + <Compile Include="Dialogs\UserInputDialogViewVM.cs" /> <Compile Include="ITestContext.cs" /> <Compile Include="ITestLogger.cs" /> + <Compile Include="Messages\TestProjectPublished.cs" /> <Compile Include="ProjectRunner.cs" /> <Compile Include="ProjectRunnerState.cs" /> <Compile Include="Result.cs" /> <Compile Include="ResultType.cs" /> <Compile Include="TestContext.cs" /> + <Compile Include="TestFailedException.cs" /> + <Compile Include="TestInput.cs" /> <Compile Include="TestProject.cs" /> + <Compile Include="UserInput.cs" /> <Compile Include="ViewModelLocator.cs" /> <Compile Include="StubsModule.cs" /> <Compile Include="ViewModels\MainViewVM.cs" /> @@ -122,6 +137,12 @@ <Compile Include="Views\TestDesignerView.xaml.cs"> <DependentUpon>TestDesignerView.xaml</DependentUpon> </Compile> + <Compile Include="Views\TestRunnerCatalogView.xaml.cs"> + <DependentUpon>TestRunnerCatalogView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\TestRunnerExecutionView.xaml.cs"> + <DependentUpon>TestRunnerExecutionView.xaml</DependentUpon> + </Compile> <Compile Include="Views\TestRunnerView.xaml.cs"> <DependentUpon>TestRunnerView.xaml</DependentUpon> </Compile> @@ -222,6 +243,14 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Dialogs\LoadPublishedProjectView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Dialogs\UserInputDialogView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Themes\Generic.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -234,6 +263,14 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Views\TestRunnerCatalogView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\TestRunnerExecutionView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Views\TestRunnerView.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -245,6 +282,15 @@ <ItemGroup> <Resource Include="Images\test_runner.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\project.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\test_tools.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\project_small.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="..\..\..\packages\MaterialDesignThemes.3.0.1\build\MaterialDesignThemes.targets" Condition="Exists('..\..\..\packages\MaterialDesignThemes.3.0.1\build\MaterialDesignThemes.targets')" /> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/TestContext.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/TestContext.cs index 909b026d6..9761a9378 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/TestContext.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/TestContext.cs @@ -1,17 +1,22 @@ using System; +using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; using System.Linq; +using System.Reactive.Concurrency; +using System.Reactive.Linq; using System.Reflection; using System.Text; using System.Threading; using System.Threading.Tasks; using Google.Protobuf; using Tango.Core.DI; +using Tango.Core.ExtensionMethods; using Tango.FSE.Common.Connection; using Tango.FSE.Common.Notifications; using Tango.FSE.Common.Threading; +using Tango.FSE.Stubs.Dialogs; using Tango.Integration.Operation; using Tango.PMR; using Tango.Scripting.Basic; @@ -21,6 +26,8 @@ namespace Tango.FSE.Stubs public class TestContext : ITestContext { private ITestLogger _logger; + private TestProject _project; + private Dictionary<String, TestInput> _inputs; [TangoInject] private IMachineProvider MachineProvider { get; set; } @@ -33,19 +40,27 @@ namespace Tango.FSE.Stubs public ReadOnlyCollection<Result> Results { get; private set; } - public TestContext(ITestLogger logger) + public TestContext(TestProject project, ITestLogger logger) { + _project = project; + _inputs = new Dictionary<string, TestInput>(); + + foreach (var input in _project.Inputs) + { + _inputs.Add(input.Key, input); + } + _logger = logger; Results = new ReadOnlyCollection<Result>(new List<Result>()); TangoIOC.Default.Inject(this); } - public IMessage Run(string stubName, params object[] args) + public IMessage Run(string messageName, int? timeout = null, params object[] args) { - var stubType = MessageFactory.GetAvailableRequestStubs().SingleOrDefault(x => x.Name.ToLower() == stubName.ToLower() || x.Name.Replace("Request", "").ToLower() == stubName.ToLower()); + var stubType = MessageFactory.GetAvailableRequestStubs().SingleOrDefault(x => x.Name.ToLower() == messageName.ToLower() || x.Name.Replace("Request", "").ToLower() == messageName.ToLower()); if (stubType == null) { - throw new ArgumentException("Invalid stub '" + stubName + "'."); + throw new ArgumentException("Invalid stub '" + messageName + "'."); } var stubProps = stubType.GetProperties(BindingFlags.Public | BindingFlags.Instance); @@ -81,50 +96,73 @@ namespace Tango.FSE.Stubs } } - return Run(request as IMessage); + return Run(request as IMessage, timeout); } - public T Run<T>(string stubName, params object[] args) where T : class, IMessage + public T Run<T>(string messageName, int? timeout = null, params object[] args) where T : class, IMessage { - return Run(stubName, args) as T; + return Run(messageName, timeout, args) as T; } - public IMessage Run(IMessage stub) + public IMessage Run(IMessage message, int? timeout = null) { - return MachineProvider.MachineOperator.SendRequest(stub, new Transport.TransportRequestConfig()).Result; + TimeSpan? timespan = null; + + if (timeout != null) + { + timespan = TimeSpan.FromMilliseconds(timeout.Value); + } + + return MachineProvider.MachineOperator.SendRequest(message, new Transport.TransportRequestConfig() + { + Timeout = timespan, + }).Result; } - public T Run<T>(IMessage stub) where T : class, IMessage + public T Run<T>(IMessage messageName, int? timeout = null) where T : class, IMessage { - return Run(stub) as T; + return Run(messageName, timeout) as T; } - public void RunContinuous<T>(T stub, Action<T> callback) where T : class, IMessage + public void RunContinuous<T>(IMessage messageName, Action<T> callback, int? timeout = null) where T : class, IMessage { - Type stubType = stub.GetType(); + TaskCompletionSource<object> completion = new TaskCompletionSource<object>(); + + TimeSpan? timespan = null; - MachineProvider.MachineOperator.SendContinuousRequest(stub, new Transport.TransportContinuousRequestConfig()).Subscribe((msg) => + if (timeout != null) { - callback?.Invoke(msg as T); + timespan = TimeSpan.FromMilliseconds(timeout.Value); + } - //Next + MachineProvider.MachineOperator.SendContinuousRequest(messageName, new Transport.TransportContinuousRequestConfig() + { + Timeout = timespan, + ContinuousTimeout = timespan + }).ObserveOn(new NewThreadScheduler()).Subscribe((msg) => + { + try + { + callback?.Invoke(msg as T); + } + catch { } }, (ex) => { - //OnFailed(ex); - //Error + completion.SetException(ex); }, () => { - //OnCompleted("Continuous request completed."); - //Completed + completion.SetResult(true); }); + + completion.Task.GetAwaiter().GetResult(); } - public void RunContinuous<T>(string stubName, Action<T> callback, params object[] args) where T : class, IMessage + public void RunContinuous<T>(string messageName, Action<T> callback, int? timeout = null, params object[] args) where T : class, IMessage { - var stubType = MessageFactory.GetAvailableRequestStubs().SingleOrDefault(x => x.Name.ToLower() == stubName.ToLower() || x.Name.Replace("Request", "").ToLower() == stubName.ToLower()); + var stubType = MessageFactory.GetAvailableRequestStubs().SingleOrDefault(x => x.Name.ToLower() == messageName.ToLower() || x.Name.Replace("Request", "").ToLower() == messageName.ToLower()); if (stubType == null) { - throw new ArgumentException("Invalid stub '" + stubName + "'."); + throw new ArgumentException("Invalid stub '" + messageName + "'."); } var stubProps = stubType.GetProperties(BindingFlags.Public | BindingFlags.Instance); @@ -160,17 +198,45 @@ namespace Tango.FSE.Stubs } } - RunContinuous<IMessage>(request, callback as Action<IMessage>); + RunContinuous<IMessage>(request, callback as Action<IMessage>, timeout); } public void WriteLine(object obj) { - _logger?.WriteLine(obj != null ? obj.ToString() : "null"); + String line = "null"; + + if (obj != null) + { + if (!obj.GetType().IsValueTypeOrString()) + { + line = obj.ToJsonString(); + } + else + { + line = obj.ToString(); + } + } + + _logger?.WriteLine(line); } public void Write(object obj) { - _logger?.Write(obj != null ? obj.ToString() : "null"); + String line = "null"; + + if (obj != null) + { + if (obj.GetType().IsClass) + { + line = obj.ToJsonString(); + } + else + { + line = obj.ToString(); + } + } + + _logger?.WriteLine(line); } public void WriteLineHex(object number, int digits) @@ -223,5 +289,162 @@ namespace Tango.FSE.Stubs { Results = new ReadOnlyCollection<Result>(new List<Result>()); } + + public T GetInput<T>(string key) + { + var value = GetInput(key); + + try + { + return (T)Convert.ChangeType(value, typeof(T)); + } + catch + { + throw new InvalidCastException($"Error converting the specified input '{value}' to type '{typeof(T).Name}'."); + } + } + + public List<T> GetInputArray<T>(String key) + { + var value = GetInput(key); + + String[] arr = value.ToStringSafe().Split(','); + var list = new List<T>(arr.Select(x => (T)Convert.ChangeType(x, typeof(T)))); + + return list; + } + + public object GetInput(string key) + { + TestInput input = null; + + if (_inputs.TryGetValue(key, out input)) + { + return input.Value; + } + else + { + throw new KeyNotFoundException($"Could no find input with key '{key}'."); + } + } + + public void Fail(string message) + { + throw new TestFailedException(message); + } + + public void ShowInfo(string message) + { + TaskCompletionSource<object> completion = new TaskCompletionSource<object>(); + + DispatcherProvider.Invoke(async () => + { + await NotificationProvider.ShowInfo(message); + completion.SetResult(true); + }); + + completion.Task.GetAwaiter().GetResult(); + } + + public void ShowWarning(string message) + { + TaskCompletionSource<object> completion = new TaskCompletionSource<object>(); + + DispatcherProvider.Invoke(async () => + { + await NotificationProvider.ShowWarning(message); + completion.SetResult(true); + }); + + completion.Task.GetAwaiter().GetResult(); + } + + public void ShowError(string message) + { + TaskCompletionSource<object> completion = new TaskCompletionSource<object>(); + + DispatcherProvider.Invoke(async () => + { + await NotificationProvider.ShowError(message); + completion.SetResult(true); + }); + + completion.Task.GetAwaiter().GetResult(); + } + + public bool ShowQuestion(string message) + { + TaskCompletionSource<bool> completion = new TaskCompletionSource<bool>(); + + DispatcherProvider.Invoke(async () => + { + var result = await NotificationProvider.ShowQuestion(message); + completion.SetResult(result); + }); + + return completion.Task.GetAwaiter().GetResult(); + } + + public bool ShowWarningQuestion(string message) + { + TaskCompletionSource<bool> completion = new TaskCompletionSource<bool>(); + + DispatcherProvider.Invoke(async () => + { + var result = await NotificationProvider.ShowWarningQuestion(message); + completion.SetResult(result); + }); + + return completion.Task.GetAwaiter().GetResult(); + } + + public T RequestUserInputFor<T>(string title, string message) + { + return RequestUserInputFor<T>(Activator.CreateInstance<T>(), title, message); + } + + public T RequestUserInputFor<T>(T model, string title, string message) + { + UserInputDialogViewVM vm = new UserInputDialogViewVM(title, message, model); + vm.Init(); + + TaskCompletionSource<T> completion = new TaskCompletionSource<T>(); + + DispatcherProvider.Invoke(async () => + { + await NotificationProvider.ShowDialog(vm); + completion.SetResult(model); + }); + + var result = completion.Task.GetAwaiter().GetResult(); + vm.FinalizeModel(); + return model; + } + + public void WriteLineArray(IEnumerable array, ArrayParsingStyle style) + { + String line = String.Empty; + + List<Object> list = new List<object>(); + + foreach (var item in array) + { + list.Add(item); + } + + if (style == ArrayParsingStyle.Comma) + { + line = String.Join(", ", list.Select(x => x.ToStringSafe())); + } + else + { + foreach (var item in list) + { + line += $"[{item.ToStringSafe()}] "; + } + } + + WriteLine(line); + } } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/TestFailedException.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/TestFailedException.cs new file mode 100644 index 000000000..0e6e26dd4 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/TestFailedException.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.FSE.Stubs +{ + public class TestFailedException : Exception + { + public TestFailedException(String message) : base(message) + { + + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/TestInput.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/TestInput.cs new file mode 100644 index 000000000..71015e4e2 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/TestInput.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.FSE.Stubs +{ + public class TestInput + { + public String DisplayName { get; set; } + public String Description { get; set; } + public String Key { get; set; } + public Object Value { get; set; } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/TestProject.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/TestProject.cs index 533764392..2ba4a74cd 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/TestProject.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/TestProject.cs @@ -1,6 +1,8 @@ using Google.Protobuf; +using Newtonsoft.Json; using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -13,13 +15,31 @@ namespace Tango.FSE.Stubs { public class TestProject : Project<TestContext> { + private static JsonSerializerSettings _jsonSettings; + + public ObservableCollection<TestInput> Inputs { get; set; } + + static TestProject() + { + _jsonSettings = new JsonSerializerSettings() + { + TypeNameHandling = TypeNameHandling.Auto, + PreserveReferencesHandling = PreserveReferencesHandling.All, + }; + } + + public TestProject() : base() + { + Inputs = new ObservableCollection<TestInput>(); + } + public static TestProject New(String name) { TestProject project = new TestProject(); project.Name = name; project.Scripts.Add(Script.New("Program.csx", Encoding.UTF8.GetString(Properties.Resources.main_template), true)); - project.Scripts.Add(Script.New("lib.csx", Encoding.UTF8.GetString(Properties.Resources.lib_template))); + project.Scripts.Add(Script.New("Service.csx", Encoding.UTF8.GetString(Properties.Resources.lib_template).Replace("@LibraryName", "Service"))); project.ReferenceAssemblies.Add(ReferenceAssembly.FromType(typeof(String))); project.ReferenceAssemblies.Add(ReferenceAssembly.FromType(typeof(Enumerable))); @@ -33,5 +53,15 @@ namespace Tango.FSE.Stubs return project; } + + public String ToJson() + { + return JsonConvert.SerializeObject(this, _jsonSettings); + } + + public static TestProject FromJson(String json) + { + return JsonConvert.DeserializeObject<TestProject>(json, _jsonSettings); + } } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/UserInput.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/UserInput.cs new file mode 100644 index 000000000..85282e781 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/UserInput.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.FSE.Stubs +{ + public class UserInput : Attribute + { + public String Name { get; set; } + + public UserInput(String name) + { + Name = name; + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ViewModels/TestDesignerViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ViewModels/TestDesignerViewVM.cs index 87835316d..cc5cdfdc7 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ViewModels/TestDesignerViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ViewModels/TestDesignerViewVM.cs @@ -1,40 +1,67 @@ using Google.Protobuf; +using MaterialDesignThemes.Wpf; using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.IO; using System.Linq; using System.Reflection; using System.Text; +using System.Threading; using System.Threading.Tasks; +using System.Windows; using System.Windows.Input; using System.Windows.Threading; +using Tango.BL.Entities; using Tango.Core; using Tango.Core.Commands; using Tango.Core.ExtensionMethods; using Tango.FSE.Common; +using Tango.FSE.Common.Navigation; +using Tango.FSE.Stubs.Contracts; using Tango.FSE.Stubs.Dialogs; +using Tango.FSE.Stubs.Messages; using Tango.Integration.Operation; using Tango.Scripting.Basic; using Tango.Scripting.Editors; using Tango.SharedUI.Components; using Tango.SharedUI.Helpers; using Tango.Transport; +using static Tango.FSE.Stubs.ViewModels.TestDesignerViewVM; namespace Tango.FSE.Stubs.ViewModels { - public class TestDesignerViewVM : FSEViewModel, ITestLogger + public class TestDesignerViewVM : FSEViewModel<ITestDesignerView>, ITestLogger, INavigationObjectReceiver<NavigationObject> { + public class NavigationObject + { + public PublishedTestProject Project { get; set; } + } + public enum ToolWindows { Output, Errors, - Results + Inputs, + Results, + Publish } - private DispatcherTimer _compileTimer; + private System.Timers.Timer _compileTimer; + private String _projectFile; + private String PROJECT_FILE_EXTENSION = ".tproj"; + private String PROJECT_DIALOG_FILTER = $"Test Project Files|*.tproj"; + private bool _isProjectChanged; #region Properties + private PublishedTestProject _publishedTestProject; + public PublishedTestProject PublishedTestProject + { + get { return _publishedTestProject; } + set { _publishedTestProject = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + private ToolWindows _selectedToolWindow; public ToolWindows SelectedToolWindow { @@ -109,6 +136,21 @@ namespace Tango.FSE.Stubs.ViewModels set { _loadedAssemblies = value; RaisePropertyChangedAuto(); } } + private bool _isPublishPanelOpened; + public bool IsPublishPanelOpened + { + get { return _isPublishPanelOpened; } + set { _isPublishPanelOpened = value; RaisePropertyChangedAuto(); } + } + + private List<CreateGroup> _createGroups; + public List<CreateGroup> CreateGroups + { + get { return _createGroups; } + set { _createGroups = value; RaisePropertyChangedAuto(); } + } + + #endregion #region Commands @@ -120,6 +162,23 @@ namespace Tango.FSE.Stubs.ViewModels public RelayCommand CompileProjectCommand { get; set; } public RelayCommand AddReferenceAssemblyCommand { get; set; } public RelayCommand<ReferenceAssembly> RemoveReferenceAssemblyCommand { get; set; } + public RelayCommand AddProjectInputCommand { get; set; } + public RelayCommand<TestInput> RemoveProjectInputCommand { get; set; } + public RelayCommand FormatCodeCommand { get; set; } + public RelayCommand<CompilationError> HighlightErrorCommand { get; set; } + public RelayCommand NewProjectCommand { get; set; } + public RelayCommand SaveProjectCommand { get; set; } + public RelayCommand SaveAsProjectCommand { get; set; } + public RelayCommand OpenProjectCommand { get; set; } + public RelayCommand AddLibraryCommand { get; set; } + public RelayCommand<Script> DeleteLibraryCommand { get; set; } + public RelayCommand ClearOutputCommand { get; set; } + public RelayCommand PublishProjectCommand { get; set; } + public RelayCommand LoadPublishedProjectCommand { get; set; } + public RelayCommand UnPublishProjectCommand { get; set; } + public RelayCommand TogglePublishPanelCommand { get; set; } + public RelayCommand<Script> RenameLibraryCommand { get; set; } + public RelayCommand<CreateItem> CreateItemCommand { get; set; } #endregion @@ -130,7 +189,7 @@ namespace Tango.FSE.Stubs.ViewModels Status = "Ready"; LoadedAssemblies = new ObservableCollection<Assembly>(); - + Results = new List<Result>(); CompilationErrors = new List<CompilationError>(); Logger = new TextController(); ScriptEditor.LoadingSymbolsProgress += ScriptEditor_LoadingSymbolsProgress; @@ -147,13 +206,134 @@ namespace Tango.FSE.Stubs.ViewModels CompileProjectCommand = new RelayCommand(async () => await CompileProject(), () => ProjectRunner != null && ProjectRunner.CanCompile); AddReferenceAssemblyCommand = new RelayCommand(AddReferenceAssembly); RemoveReferenceAssemblyCommand = new RelayCommand<ReferenceAssembly>(RemoveReferenceAssembly); + AddProjectInputCommand = new RelayCommand(AddProjectInput); + RemoveProjectInputCommand = new RelayCommand<TestInput>(RemoveProjectInput); + FormatCodeCommand = new RelayCommand(FormatCode); + HighlightErrorCommand = new RelayCommand<CompilationError>(HighlightError); + NewProjectCommand = new RelayCommand(CreateNewProject, () => ProjectRunner == null || !ProjectRunner.IsRunning); + SaveProjectCommand = new RelayCommand(SaveProject); + SaveAsProjectCommand = new RelayCommand(SaveAsProject); + OpenProjectCommand = new RelayCommand(OpenProject); + AddLibraryCommand = new RelayCommand(AddNewLibrary); + ClearOutputCommand = new RelayCommand(Clear); + DeleteLibraryCommand = new RelayCommand<Script>(DeleteLibrary); + PublishProjectCommand = new RelayCommand(PublishProject); + LoadPublishedProjectCommand = new RelayCommand(LoadPublishedProject); + UnPublishProjectCommand = new RelayCommand(UnPublishProject); + TogglePublishPanelCommand = new RelayCommand(() => IsPublishPanelOpened = !IsPublishPanelOpened); + RenameLibraryCommand = new RelayCommand<Script>(RenameLibrary); + CreateItemCommand = new RelayCommand<CreateItem>(AutoCreateItem); + } + + #endregion + + #region Auto Creation + + private void InitCreateGroups() + { + var groups = new List<CreateGroup>(); + + foreach (var typesGroup in typeof(PMR.Common.MessageContainer).Assembly.GetTypes().Where(x => x.IsClass && !x.IsGenericType && !x.Name.Contains("Reflection") && typeof(IMessage).IsAssignableFrom(x)).GroupBy(x => x.Namespace)) + { + CreateGroup group = new CreateGroup(); + group.Name = typesGroup.First().Namespace.Split('.').Last(); + + foreach (var type in typesGroup) + { + group.Items.Add(new CreateItem() + { + Name = type.Name, + Type = type, + }); + } + + groups.Add(group); + } + + CreateGroups = groups; + } + + private void AutoCreateItem(CreateItem item) + { + if (item != null) + { + try + { + String code = String.Empty; + FormatProperties(item.Type, ref code); + View.InsertCode(code); + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error generating code for {item.Type.Name}."); + NotificationProvider.ShowError($"Error generating code for {item.Type.Name}."); + } + } + } - _compileTimer = new DispatcherTimer(DispatcherPriority.ApplicationIdle); - _compileTimer.Interval = TimeSpan.FromSeconds(2); - _compileTimer.Tick += _compileTimer_Tick; + private void FormatProperties(Type type, ref String code) + { + code += Environment.NewLine + String.Format("{0} {1} = new {0}();", type.Name, type.Name.ToCamelCase()) + Environment.NewLine; + + foreach (var prop in type.GetProperties(BindingFlags.Instance | BindingFlags.Public)) + { + if (prop.PropertyType == typeof(String)) + { + code += String.Format("{0}.{1} = {2};", type.Name.ToCamelCase(), prop.Name, "null") + Environment.NewLine; + } + else if (prop.PropertyType.IsEnum) + { + code += String.Format("{0}.{1} = {2};", type.Name.ToCamelCase(), prop.Name, Activator.CreateInstance(prop.PropertyType).GetType().FullName + "." + Activator.CreateInstance(prop.PropertyType).ToString()) + Environment.NewLine; + } + else if (!prop.PropertyType.IsClass) + { + code += String.Format("{0}.{1} = {2};", type.Name.ToCamelCase(), prop.Name, Activator.CreateInstance(prop.PropertyType).ToString().ToLower()) + Environment.NewLine; + } + else if (prop.PropertyType.IsGenericType) + { + Type genericType = prop.PropertyType.GenericTypeArguments[0]; + FormatProperties(genericType, ref code); + code += String.Format("{0}.{1}.Add({2});", type.Name.ToCamelCase(), prop.Name, genericType.Name.ToCamelCase()) + Environment.NewLine; + } + else + { + FormatProperties(prop.PropertyType, ref code); + code += Environment.NewLine + String.Format("{0}.{1} = {2};", type.Name.ToCamelCase(), prop.Name, prop.Name.ToCamelCase()) + Environment.NewLine; + } + } + } + + #endregion + + #region Override Methods + + public override void OnApplicationStarted() + { + _compileTimer = new System.Timers.Timer(2000); + _compileTimer.Elapsed += _compileTimer_Tick; _compileTimer.Start(); - CreateNewProject(); + Task.Factory.StartNew(() => + { + try + { + InitCreateGroups(); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error generating test designer auto creation groups."); + } + }); + } + + public override void OnNavigatedTo() + { + base.OnNavigatedTo(); + + if (Project == null) + { + CreateStartupProject(); + } } #endregion @@ -238,12 +418,17 @@ namespace Tango.FSE.Stubs.ViewModels Results = new List<Result>(); Logger.Clear(); Logger.WriteLine("Running project..."); - var context = new TestContext(this); + var context = new TestContext(Project, this); await ProjectRunner.Run(context); - Logger.WriteLine("Project ran to completion with test result:"); - Logger.WriteLine(context.Results.ToJsonString()); + Results = context.Results.ToList(); - SelectedToolWindow = ToolWindows.Results; + + if (Results.Count > 0) + { + Logger.WriteLine("Project ran to completion with test result:"); + Logger.WriteLine(Results.ToJsonString()); + SelectedToolWindow = ToolWindows.Results; + } } } catch (OperationCanceledException) @@ -279,6 +464,12 @@ namespace Tango.FSE.Stubs.ViewModels SelectedScript = script; } + private void ClearOpenedScripts() + { + OpenScripts.Clear(); + SelectedScript = null; + } + #endregion #region Event Handlers @@ -298,7 +489,7 @@ namespace Tango.FSE.Stubs.ViewModels { CompilationErrors = (await Project.Compile()).Errors; - if (CompilationErrors.Count > 0) + if (CompilationErrors.Count > 0 && (SelectedToolWindow == ToolWindows.Output || SelectedToolWindow == ToolWindows.Results)) { SelectedToolWindow = ToolWindows.Errors; } @@ -309,7 +500,7 @@ namespace Tango.FSE.Stubs.ViewModels #endregion - #region Private Methods + #region Reference Assemblies private async void AddReferenceAssembly() { @@ -323,22 +514,122 @@ namespace Tango.FSE.Stubs.ViewModels Project.ReferenceAssemblies.Add(asm); } + _isProjectChanged = true; + LoadReferenceAssemblies(); } } - private void CreateNewProject() + private void LoadReferenceAssemblies() + { + LoadedAssemblies = Project.LoadReferenceAssemblies().ToObservableCollection(); + } + + private void RemoveReferenceAssembly(ReferenceAssembly assembly) + { + Project.ReferenceAssemblies.Remove(assembly); + _isProjectChanged = true; + LoadedAssemblies = Project.LoadReferenceAssemblies().ToObservableCollection(); + } + + #endregion + + #region Project Management + + private async void CreateNewProject() + { + if (await CheckDiscardProjectChanges()) + { + var result = await NotificationProvider.ShowInputBox("New Project", "Please specify the project name", PackIconKind.TestTube, "untitled", "Project Name", 100, "CREATE"); + if (result.Confirmed) + { + Project = TestProject.New(result.Input); + _projectFile = null; + PublishedTestProject = null; + } + } + } + + private void CreateStartupProject() { - Project = TestProject.New("test1"); - LoadReferenceAssemblies(); + Project = TestProject.New("untitled"); + _projectFile = null; + } + + private void SaveProject() + { + if (Project != null) + { + if (_projectFile == null) + { + SaveAsProject(); + return; + } + + try + { + Status = "Saving project..."; + + File.WriteAllText(_projectFile, Project.ToJson()); + + Status = "Project saved."; + + Project.Scripts.ToList().ForEach(x => x.IsChanged = false); + _isProjectChanged = false; + } + catch (Exception ex) + { + NotificationProvider.ShowError($"Error saving project\n{ex.FlattenMessage()}"); + Status = "Ready"; + } + } + } + + private async void SaveAsProject() + { + if (Project != null) + { + var result = await StorageProvider.SaveFile("Save As Project", PROJECT_DIALOG_FILTER, Project.Name, PROJECT_FILE_EXTENSION); + + if (result) + { + try + { + Status = "Saving project..."; + + File.WriteAllText(result.SelectedItem, Project.ToJson()); + _projectFile = result.SelectedItem; + + Status = "Project saved."; + + Project.Scripts.ToList().ForEach(x => x.IsChanged = false); + _isProjectChanged = false; + } + catch (Exception ex) + { + await NotificationProvider.ShowError($"Error saving project\n{ex.FlattenMessage()}"); + Status = "Ready"; + } + } + } } private void OnProjectChanged() { if (Project != null) { + _isProjectChanged = false; + LoadReferenceAssemblies(); ProjectRunner = new ProjectRunner(Project); ProjectRunner.StateChanged += ProjectRunner_StateChanged; + ClearOpenedScripts(); + + var programScript = Project.Scripts.SingleOrDefault(x => x.IsEntryPoint); + + if (programScript != null) + { + OpenScript(programScript); + } } else { @@ -348,15 +639,103 @@ namespace Tango.FSE.Stubs.ViewModels InvalidateRelayCommands(); } - private void LoadReferenceAssemblies() + private async void OpenProject() { - LoadedAssemblies = Project.LoadReferenceAssemblies().ToObservableCollection(); + if (await CheckDiscardProjectChanges()) + { + var result = await StorageProvider.OpenFile("Open Test Project", PROJECT_DIALOG_FILTER); + + if (result) + { + OpenProject(result.SelectedItem); + } + } } - private void RemoveReferenceAssembly(ReferenceAssembly assembly) + private void OpenProject(String file) { - Project.ReferenceAssemblies.Remove(assembly); - LoadedAssemblies = Project.LoadReferenceAssemblies().ToObservableCollection(); + try + { + Project = TestProject.FromJson(File.ReadAllText(file)); + _projectFile = file; + PublishedTestProject = null; + Status = "Project loaded."; + } + catch (Exception ex) + { + LogManager.Log(ex, "Error opening test project."); + NotificationProvider.ShowError($"Error occurred while trying to open the project.\n{ex.FlattenMessage()}"); + } + } + + private async Task<bool> CheckDiscardProjectChanges() + { + if (Project != null && (Project.Scripts.Any(x => x.IsChanged) || _isProjectChanged)) + { + return await NotificationProvider.ShowWarningQuestion("The current project contains unsaved changes. Discard the changes?"); + } + else + { + return true; + } + } + + #endregion + + #region Libraries + + private async void AddNewLibrary() + { + var result = await NotificationProvider.ShowInputBox("New Library File", "Please specify the library name", PackIconKind.Script, "MyLibrary", "Library Name", 100, "ADD LIBRARY"); + + if (result.Confirmed) + { + if (Project.Scripts.Any(x => x.Name.ToLower() == result.Input.ToLower() + ".csx")) + { + await NotificationProvider.ShowError($"The project already contains a file named '{result.Input}'."); + return; + } + + try + { + var lib = Script.New(result.Input + ".csx", Encoding.UTF8.GetString(Properties.Resources.lib_template).Replace("@LibraryName", result.Input)); + Project.Scripts.Add(lib); + _isProjectChanged = true; + OpenScript(lib); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error adding new library to test project."); + await NotificationProvider.ShowError($"Could not add a new script to the project.\n{ex.FlattenMessage()}"); + } + } + } + + private async void DeleteLibrary(Script script) + { + if (script.IsEntryPoint) + { + await NotificationProvider.ShowWarning("Entry point file cannot be deleted."); + return; + } + + if (await NotificationProvider.ShowWarningQuestion($"Are you sure you want to delete '{script.Name}'?")) + { + CloseScript(script); + Project.Scripts.Remove(script); + _isProjectChanged = true; + } + } + + private async void RenameLibrary(Script script) + { + var result = await NotificationProvider.ShowInputBox("Rename Library File", "Please specify a new library name", PackIconKind.Rename, Path.GetFileNameWithoutExtension(script.Name), "Library Name", 100, "RENAME"); + + if (result.Confirmed) + { + script.Name = result.Input + ".csx"; + script.IsChanged = true; + } } #endregion @@ -379,5 +758,199 @@ namespace Tango.FSE.Stubs.ViewModels } #endregion + + #region Inputs + + private void AddProjectInput() + { + Project.Inputs.Add(new TestInput() + { + Key = "param" + (Project.Inputs.Count + 1), + Value = "0", + DisplayName = "Parameter " + (Project.Inputs.Count + 1), + Description = "Controls the " + (Project.Inputs.Count + 1 + " parameter."), + }); + } + + private void RemoveProjectInput(TestInput input) + { + Project.Inputs.Remove(input); + } + + #endregion + + #region Publish + + private async void LoadPublishedProject() + { + try + { + IsFree = false; + + List<PublishedTestProject> projects = new List<PublishedTestProject>(); + + using (NotificationProvider.PushTaskItem("Retrieving published projects...")) + { + projects = await Services.PublishedTestProjectsService.GetPublishedTestProjects(false); + } + + if (projects.Count == 0) + { + await NotificationProvider.ShowInfo("No published test projects found. Please publish a test project before trying to load one."); + return; + } + + var vm = await NotificationProvider.ShowDialog<LoadPublishedProjectViewVM>(new LoadPublishedProjectViewVM(projects)); + + if (vm.DialogResult) + { + await LoadPublishedProject(vm.SelectedProject); + await NotificationProvider.ShowSuccess("Project loaded successfully."); + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error retrieving published test projects."); + await NotificationProvider.ShowError($"Error occurred while trying to fetch published test projects.\n{ex.FlattenMessage()}"); + } + finally + { + IsFree = true; + } + } + + private async Task LoadPublishedProject(PublishedTestProject project) + { + try + { + if (project == null) + { + throw new NullReferenceException("No project provided."); + } + + if (!await CheckDiscardProjectChanges()) return; + + using (NotificationProvider.PushTaskItem("Loading published project...")) + { + await Task.Delay(1000); + Project = TestProject.FromJson(project.CurrentVersion.ProjectJsonString); + PublishedTestProject = project; + _projectFile = null; + await Task.Delay(1000); + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error loading published test project."); + await NotificationProvider.ShowError($"Error loading published test project.\n{ex.FlattenMessage()}"); + } + } + + private async void PublishProject() + { + try + { + if (!Project.Name.IsNotNullOrEmpty()) + { + await NotificationProvider.ShowError("Please provide a project name."); + return; + } + + if (PublishedTestProject == null || !PublishedTestProject.IsVisible) + { + if (!await NotificationProvider.ShowWarningQuestion("Publishing this project will make it available for all users via the Test Runner module.", "PUBLISH")) + { + return; + } + } + else + { + if (!await NotificationProvider.ShowWarningQuestion("This project is already published. Do you want to update the published project?", "UPDATE")) + { + return; + } + } + + IsFree = false; + + using (NotificationProvider.PushTaskItem("Publishing test project...")) + { + PublishedTestProject = await Services.PublishedTestProjectsService.PublishTestProject( + PublishedTestProject?.Guid, + Project.Name, + Project.Description, + Project.ToJson()); + + RaiseMessage<TestProjectPublishedOrSuppressed>(); + } + + await NotificationProvider.ShowSuccess("Your test project is now published!\nNow you can execute this project from the Test Runner module."); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error publishing test project."); + await NotificationProvider.ShowError($"Error publishing test project.\n{ex.FlattenMessage()}"); + } + finally + { + IsFree = true; + } + } + + private async void UnPublishProject() + { + if (!await NotificationProvider.ShowWarningQuestion("Suppressing this project will make it unavailable on the Test Runner module.\nAre you sure?", "SUPPRESS")) + { + return; + } + + try + { + using (NotificationProvider.PushTaskItem("Suppressing test project...")) + { + PublishedTestProject = await Services.PublishedTestProjectsService.UnPublishTestProject(PublishedTestProject); + RaiseMessage<TestProjectPublishedOrSuppressed>(); + } + + await NotificationProvider.ShowInfo("This test project will no longer be available on the Test Runner module."); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error suppressing test project."); + await NotificationProvider.ShowError($"Error occurred while trying to suppress this test project.\n{ex.FlattenMessage()}"); + } + } + + #endregion + + #region View + + private void HighlightError(CompilationError error) + { + var errorScript = Project.Scripts.SingleOrDefault(x => x.Name == error.File); + + if (errorScript != null) + { + OpenScript(errorScript); + View.HighlightCode(error.Position, error.Length); + } + } + + private void FormatCode() + { + View.FormatCode(); + } + + #endregion + + #region INavigationObjectReceiver + + public async void OnNavigatedToWithObject(NavigationObject obj) + { + await Task.Delay(500); + await LoadPublishedProject(obj.Project); + } + + #endregion } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ViewModels/TestRunnerViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ViewModels/TestRunnerViewVM.cs index d3e968774..6e4ec2b74 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ViewModels/TestRunnerViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ViewModels/TestRunnerViewVM.cs @@ -3,11 +3,212 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.Core.Commands; using Tango.FSE.Common; +using Tango.FSE.Stubs.Messages; +using Tango.FSE.Stubs.Views; namespace Tango.FSE.Stubs.ViewModels { - public class TestRunnerViewVM : FSEViewModel + public class TestRunnerViewVM : FSEViewModel, ITestLogger { + public enum RunnerView + { + TestRunnerCatalogView, + TestRunnerExecutionView + } + + private bool _requiresReloadingOfProjects; + + private RunnerView _selectedView; + public RunnerView SelectedView + { + get { return _selectedView; } + set { _selectedView = value; RaisePropertyChangedAuto(); } + } + + private List<PublishedTestProject> _publishedTestProjects; + public List<PublishedTestProject> PublishedTestProjects + { + get { return _publishedTestProjects; } + set { _publishedTestProjects = value; RaisePropertyChangedAuto(); } + } + + private TestProject _runningTestProject; + public TestProject RunningTestProject + { + get { return _runningTestProject; } + set { _runningTestProject = value; RaisePropertyChangedAuto(); } + } + + private ProjectRunner _projectRunner; + public ProjectRunner ProjectRunner + { + get { return _projectRunner; } + set { _projectRunner = value; RaisePropertyChangedAuto(); } + } + + private bool _isLoadingProjects; + public bool IsLoadingProjects + { + get { return _isLoadingProjects; } + set { _isLoadingProjects = value; RaisePropertyChangedAuto(); } + } + + public bool HasTestInputs + { + get { return RunningTestProject != null && RunningTestProject.Inputs.Count > 0; } + } + + private List<Result> _results; + public List<Result> Results + { + get { return _results; } + set { _results = value; RaisePropertyChangedAuto(); } + } + + private String _status; + public String Status + { + get { return _status; } + set { _status = value; RaisePropertyChangedAuto(); } + } + + private String _failedError; + public String FailedError + { + get { return _failedError; } + set { _failedError = value; RaisePropertyChangedAuto(); } + } + + public RelayCommand<PublishedTestProject> EditProjectCommand { get; set; } + public RelayCommand<PublishedTestProject> RunProjectCommand { get; set; } + public RelayCommand StartProjectCommand { get; set; } + public RelayCommand StopProjectCommand { get; set; } + + public TestRunnerViewVM() + { + EditProjectCommand = new RelayCommand<PublishedTestProject>(EditProject); + RunProjectCommand = new RelayCommand<PublishedTestProject>(RunProject); + StartProjectCommand = new RelayCommand(StartProject, () => ProjectRunner != null && ProjectRunner.CanRun); + StopProjectCommand = new RelayCommand(StopProject, () => ProjectRunner != null && ProjectRunner.IsRunning); + + _requiresReloadingOfProjects = true; + RegisterForMessage<TestProjectPublishedOrSuppressed>((x) => _requiresReloadingOfProjects = true); + } + + private async void StartProject() + { + try + { + FailedError = null; + Results = new List<Result>(); + Status = "Running..."; + var context = new TestContext(RunningTestProject, this); + await ProjectRunner.Run(context); + Status = "Completed"; + Results = context.Results.ToList(); + } + catch (OperationCanceledException) + { + Status = "Stopped"; + } + catch (Exception ex) + { + Status = "Failed"; + FailedError = ex.FlattenMessage(); + } + } + + private void StopProject() + { + ProjectRunner.Stop(); + } + + private void EditProject(PublishedTestProject project) + { + if (project != null) + { + NavigationManager.NavigateWithObject< + StubsModule, + TestDesignerView, + TestDesignerViewVM.NavigationObject>( + new TestDesignerViewVM.NavigationObject() + { + Project = project + }); + } + } + + public override void OnNavigatedTo() + { + base.OnNavigatedTo(); + + if (_requiresReloadingOfProjects) + { + LoadPublishedTestProjects(); + } + } + + private async void LoadPublishedTestProjects() + { + try + { + IsFree = false; + IsLoadingProjects = true; + PublishedTestProjects = new List<PublishedTestProject>(); + PublishedTestProjects = await Services.PublishedTestProjectsService.GetPublishedTestProjects(); + _requiresReloadingOfProjects = false; + IsFree = true; + } + catch (Exception ex) + { + IsFree = false; + LogManager.Log(ex, "Error retrieving published test projects."); + await NotificationProvider.ShowError($"Error occurred while trying to retrieve the tests collection.\n{ex.FlattenMessage()}"); + } + finally + { + IsLoadingProjects = false; + } + } + + private void RunProject(PublishedTestProject project) + { + RunningTestProject = TestProject.FromJson(project.CurrentVersion.ProjectJsonString); + RaisePropertyChanged(nameof(HasTestInputs)); + ProjectRunner = new ProjectRunner(RunningTestProject); + ProjectRunner.StateChanged += (x, e) => InvalidateRelayCommands(); + Status = "Ready"; + InvalidateRelayCommands(); + SelectedView = RunnerView.TestRunnerExecutionView; + } + + public override Task<bool> OnNavigateBackRequest() + { + if (SelectedView == RunnerView.TestRunnerExecutionView) + { + SelectedView = RunnerView.TestRunnerCatalogView; + return Task.FromResult(false); + } + + return base.OnNavigateBackRequest(); + } + + public void WriteLine(string text) + { + Status = text; + } + + public void Write(string text) + { + Status = text; + } + + public void Clear() + { + //Do nothing + } } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestDesignerView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestDesignerView.xaml index e434e4e53..97f8cea6b 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestDesignerView.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestDesignerView.xaml @@ -4,6 +4,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:global="clr-namespace:Tango.FSE.Stubs" + xmlns:helpers="clr-namespace:Tango.SharedUI.Helpers;assembly=Tango.SharedUI" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:components="clr-namespace:Tango.SharedUI.Components;assembly=Tango.SharedUI" xmlns:vm="clr-namespace:Tango.FSE.Stubs.ViewModels" @@ -12,7 +13,7 @@ xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" xmlns:local="clr-namespace:Tango.FSE.Stubs.Views" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:TestDesignerViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.TestDesignerViewVM}" Background="{StaticResource FSE_PrimaryBackgroundBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> + d:DesignHeight="1080" d:DesignWidth="1920" d:DataContext="{d:DesignInstance Type=vm:TestDesignerViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.TestDesignerViewVM}" Background="{StaticResource FSE_PrimaryBackgroundBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> <UserControl.Resources> <components:BindingProxy x:Key="proxy" Data="{Binding}" /> @@ -21,6 +22,11 @@ <UserControl.InputBindings> <KeyBinding Key="F5" Command="{Binding RunProjectCommand}" /> <KeyBinding Key="F6" Command="{Binding CompileProjectCommand}" /> + <KeyBinding Modifiers="Ctrl" Key="S" Command="{Binding SaveProjectCommand}" /> + <KeyBinding Modifiers="Ctrl+Shift" Key="S" Command="{Binding SaveProjectCommand}" /> + <KeyBinding Modifiers="Ctrl" Key="N" Command="{Binding NewProjectCommand}" /> + <KeyBinding Modifiers="Ctrl" Key="O" Command="{Binding OpenProjectCommand}" /> + <KeyBinding Modifiers="Ctrl" Key="P" Command="{Binding TogglePublishPanelCommand}" /> </UserControl.InputBindings> <Grid> @@ -28,19 +34,42 @@ <DockPanel> <Menu IsMainMenu="True" DockPanel.Dock="Top"> <MenuItem Header="_File"> - <MenuItem Header="_New" Command="{Binding NewProjectCommand}"> + <MenuItem Header="_New" MinWidth="250" Command="{Binding NewProjectCommand}" InputGestureText="Ctrl+N"> <MenuItem.Icon> <material:PackIcon Kind="FileDocument" /> </MenuItem.Icon> </MenuItem> - <MenuItem Header="_Open" Command="{Binding OpenProjectCommand}"> + <MenuItem Header="_Open" Command="{Binding OpenProjectCommand}" InputGestureText="Ctrl+O"> <MenuItem.Icon> <material:PackIcon Kind="FileEdit" /> </MenuItem.Icon> </MenuItem> + <Separator/> + <MenuItem Header="_Save" Command="{Binding SaveProjectCommand}" InputGestureText="Ctrl+S"> + <MenuItem.Icon> + <material:PackIcon Kind="ContentSave" /> + </MenuItem.Icon> + </MenuItem> + <MenuItem Header="_Save As" Command="{Binding SaveAsProjectCommand}" InputGestureText="Ctrl+Shift+S"> + <MenuItem.Icon> + <material:PackIcon Kind="ContentSaveAll" /> + </MenuItem.Icon> + </MenuItem> + <Separator/> + <MenuItem Header="Add Library" Command="{Binding AddLibraryCommand}"> + <MenuItem.Icon> + <material:PackIcon Kind="ScriptText" /> + </MenuItem.Icon> + </MenuItem> + <Separator/> + <MenuItem Header="Load Published Project" Command="{Binding LoadPublishedProjectCommand}"> + <MenuItem.Icon> + <material:PackIcon Kind="FolderCog" /> + </MenuItem.Icon> + </MenuItem> </MenuItem> <MenuItem Header="_Edit"> - <MenuItem Header="_Undo" Command="Undo"> + <MenuItem MinWidth="250" Header="_Undo" Command="Undo"> <MenuItem.Icon> <material:PackIcon Kind="Undo" /> </MenuItem.Icon> @@ -66,9 +95,15 @@ <material:PackIcon Kind="ContentPaste" /> </MenuItem.Icon> </MenuItem> + <Separator/> + <MenuItem Header="_Format Code" InputGestureText="Ctrl+K+D" Command="{Binding FormatCodeCommand}"> + <MenuItem.Icon> + <material:PackIcon Kind="FormatColumns" /> + </MenuItem.Icon> + </MenuItem> </MenuItem> <MenuItem Header="Debug"> - <MenuItem Header="_Build" Command="{Binding CompileProjectCommand}" InputGestureText="F6" IsEnabled="{Binding ProjectRunner.CanCompile}"> + <MenuItem Header="_Build" MinWidth="250" Command="{Binding CompileProjectCommand}" InputGestureText="F6" IsEnabled="{Binding ProjectRunner.CanCompile}"> <MenuItem.Icon> <material:PackIcon Kind="PackageDown" /> </MenuItem.Icon> @@ -84,14 +119,33 @@ </MenuItem.Icon> </MenuItem> </MenuItem> - <MenuItem Header="Publish"></MenuItem> + <MenuItem Header="_Wizard" ItemsSource="{Binding CreateGroups}"> + <MenuItem.ItemContainerStyle> + <Style TargetType="{x:Type MenuItem}" BasedOn="{StaticResource {x:Type MenuItem}}"> + <Setter Property="Command" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.CreateItemCommand}" /> + <Setter Property="CommandParameter" Value="{Binding}"></Setter> + </Style> + </MenuItem.ItemContainerStyle> + <MenuItem.ItemTemplate> + <HierarchicalDataTemplate DataType="{x:Type global:CreateItem}" ItemsSource="{Binding Path=Items}"> + <TextBlock Text="{Binding Name}"/> + </HierarchicalDataTemplate> + </MenuItem.ItemTemplate> + </MenuItem> + <MenuItem Header="Publish"> + <MenuItem Header="_Publish Project" InputGestureText="Ctrl+P" Command="{Binding TogglePublishPanelCommand}" MinWidth="250"> + <MenuItem.Icon> + <material:PackIcon Kind="Publish" /> + </MenuItem.Icon> + </MenuItem> + </MenuItem> </Menu> <Grid DockPanel.Dock="Top"> <!--Toolbar--> <ToolBar ClipToBounds="False" Background="Transparent" HorizontalAlignment="Center" ToolBarTray.IsLocked="True"> - <Button ToolTip="Save"> - <material:PackIcon Kind="ContentSave" /> + <Button ToolTip="Save" Command="{Binding SaveProjectCommand}"> + <material:PackIcon Kind="ContentSave" /> </Button> <Separator /> <Button Command="Undo" ToolTip="Undo" ToolBar.OverflowMode="AsNeeded"> @@ -115,13 +169,13 @@ <Button Width="120" ToolTip="Run (F5)" ToolBar.OverflowMode="AsNeeded" Command="{Binding RunProjectCommand}" Visibility="{Binding ProjectRunner.IsRunning,Converter={StaticResource BooleanToVisibilityInverseConverter}}" IsEnabled="{Binding ProjectRunner.CanRun}"> <DockPanel> <material:PackIcon Kind="Play" Foreground="{StaticResource FSE_GreenBrush}" /> - <TextBlock Margin="5 0 0 0" VerticalAlignment="Center">Start</TextBlock> + <TextBlock Margin="10 2 0 0" VerticalAlignment="Center">Start</TextBlock> </DockPanel> </Button> <Button Width="120" ToolTip="Stop" ToolBar.OverflowMode="AsNeeded" Command="{Binding StopProjectCommand}" Visibility="{Binding ProjectRunner.IsRunning,Converter={StaticResource BooleanToVisibilityConverter}}"> <DockPanel> <material:PackIcon Kind="Stop" Foreground="{StaticResource FSE_RedBrush}" /> - <TextBlock Margin="5 0 0 0" VerticalAlignment="Center">Stop</TextBlock> + <TextBlock Margin="10 2 0 0" VerticalAlignment="Center">Stop</TextBlock> </DockPanel> </Button> </ToolBar> @@ -146,19 +200,86 @@ <Grid> <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="499*"/> <ColumnDefinition Width="5"/> - <ColumnDefinition Width="134*"/> + <ColumnDefinition MaxWidth="500" MinWidth="250" Width="134*"/> </Grid.ColumnDefinitions> - <Grid> + <Grid Width="350" Margin="0 33 0 0" Visibility="{Binding IsPublishPanelOpened,Converter={StaticResource BooleanToVisibilityConverter}}"> + <Border BorderThickness="0 0 5 0" BorderBrush="{StaticResource FSE_PrimaryBackgroundBrush}"> + <DockPanel Background="{StaticResource FSE_PrimaryBackgroundDarkBrush}"> + <Border DockPanel.Dock="Top" Padding="5" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" BorderThickness="0 1 0 0" BorderBrush="{StaticResource FSE_BorderBrush}"> + <DockPanel> + <material:PackIcon Kind="Publish" /> + <controls:IconButton DockPanel.Dock="Right" Height="15" Margin="0" Padding="0" Icon="Close" Command="{Binding TogglePublishPanelCommand}" /> + <TextBlock Margin="5 0 0 0" FontWeight="SemiBold">PUBLISH PROJECT</TextBlock> + </DockPanel> + </Border> + <DockPanel> + <Grid DockPanel.Dock="Bottom"> + <StackPanel VerticalAlignment="Top" Margin="10"> + <Button Margin="0 10 0 0" Height="50" Width="Auto" Foreground="{StaticResource FSE_GreenBrush}" Style="{StaticResource FSE_RaisedButton_Dark_Hover}" Command="{Binding PublishProjectCommand}"> + <DockPanel> + <material:PackIcon Kind="Publish" Height="20" Width="20" /> + <TextBlock Margin="20 0 0 0" VerticalAlignment="Center" >PUBLISH</TextBlock> + </DockPanel> + </Button> + </StackPanel> + </Grid> + <ScrollViewer Padding="10" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto"> + <StackPanel> + <StackPanel> + <TextBlock Foreground="{StaticResource FSE_GrayBrush}" Margin="2 0 0 0" FontSize="{StaticResource FSE_SmallFontSize}">Name</TextBlock> + <TextBox Background="{StaticResource FSE_PrimaryBackgroundBrush}" Padding="5" Text="{Binding Project.Name,UpdateSourceTrigger=PropertyChanged,NotifyOnValidationError=True,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" Margin="0 2 0 0" Style="{StaticResource FSE_Rounded_Corners_TextBox}"></TextBox> + + <TextBlock Foreground="{StaticResource FSE_GrayBrush}" Margin="2 15 0 0" FontSize="{StaticResource FSE_SmallFontSize}">Description</TextBlock> + <TextBox Text="{Binding Project.Description,UpdateSourceTrigger=PropertyChanged}" Margin="0 2 0 0" Style="{StaticResource FSE_Rounded_Corners_TextBox_Multiline}" MinHeight="100"></TextBox> + </StackPanel> + + <DockPanel Margin="0 20 0 0"> + <material:PackIcon Kind="InfoOutline" /> + <TextBlock Foreground="{StaticResource FSE_GrayBrush}" TextWrapping="Wrap" LineHeight="18" Margin="10 0 10 0" FontSize="{StaticResource FSE_SmallFontSize}"> + <Run>• Publishing a test project makes it available as a unit test via the 'Test Runner' module.</Run> + <LineBreak/> + <Run>• The system automatically keeps the history of published projects so they can be reverted to previous versions.</Run> + <LineBreak/> + <Run>• Any published project can be "suppressed" which will make it invisible to Test Runner users.</Run> + <LineBreak/> + <Run>• Suppressed projects can be edited and republished again.</Run> + </TextBlock> + </DockPanel> + + <controls:TextIconButton Margin="10 0 0 0" ToolTip="Make this unavailable on Test Runner" Icon="DeleteCircle" HorizontalAlignment="Left" Width="Auto" BorderBrush="Transparent" Foreground="{StaticResource FSE_RedBrush}" Background="Transparent" Command="{Binding UnPublishProjectCommand}"> + <Button.Style> + <Style TargetType="controls:TextIconButton" BasedOn="{StaticResource {x:Type controls:TextIconButton}}"> + <Setter Property="Visibility" Value="Hidden"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding PublishedTestProject.IsVisible}" Value="True"> + <Setter Property="Visibility" Value="Visible"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Button.Style> + <DockPanel> + <TextBlock Margin="0 0 0 0" TextDecorations="Underline">SUPPRESS PROJECT</TextBlock> + </DockPanel> + </controls:TextIconButton> + </StackPanel> + </ScrollViewer> + </DockPanel> + </DockPanel> + </Border> + </Grid> + + <Grid Grid.Column="1"> <Grid.RowDefinitions> - <RowDefinition Height="491*"/> + <RowDefinition MinHeight="35" Height="491*"/> <RowDefinition Height="5"/> - <RowDefinition Height="174*"/> + <RowDefinition MinHeight="30" Height="210*"/> </Grid.RowDefinitions> - <Grid> + <Grid Grid.Column="2"> <!--Code Editor--> <DockPanel> <Grid DockPanel.Dock="Top" Height="35"> @@ -268,7 +389,52 @@ <editors:ScriptEditor ReferenceAssemblies="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.LoadedAssemblies}" AdditionalScripts="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Project.AdditionalScripts}" - Code="{Binding Code,Mode=TwoWay}" /> + Code="{Binding Code,Mode=TwoWay}"> + + <editors:ScriptEditor.ContextMenu> + <ContextMenu> + <MenuItem Header="_Cut" Command="Cut"> + <MenuItem.Icon> + <material:PackIcon Kind="ContentCut" /> + </MenuItem.Icon> + </MenuItem> + <MenuItem Header="_Copy" Command="Copy"> + <MenuItem.Icon> + <material:PackIcon Kind="ContentCopy" /> + </MenuItem.Icon> + </MenuItem> + <MenuItem Header="_Paste" Command="Paste"> + <MenuItem.Icon> + <material:PackIcon Kind="ContentPaste" /> + </MenuItem.Icon> + </MenuItem> + <Separator/> + <MenuItem Header="_Format Code" InputGestureText="Ctrl+K+D" Command="{Binding Source={StaticResource proxy},Path=Data.FormatCodeCommand}"> + <MenuItem.Icon> + <material:PackIcon Kind="FormatColumns" /> + </MenuItem.Icon> + </MenuItem> + <Separator/> + <MenuItem Header="_Wizard" ItemsSource="{Binding Source={StaticResource proxy},Path=Data.CreateGroups}"> + <MenuItem.Icon> + <material:PackIcon Kind="Wand" /> + </MenuItem.Icon> + <MenuItem.ItemContainerStyle> + <Style TargetType="{x:Type MenuItem}" BasedOn="{StaticResource {x:Type MenuItem}}"> + <Setter Property="Command" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.CreateItemCommand}" /> + <Setter Property="CommandParameter" Value="{Binding}"></Setter> + </Style> + </MenuItem.ItemContainerStyle> + <MenuItem.ItemTemplate> + <HierarchicalDataTemplate DataType="{x:Type global:CreateItem}" ItemsSource="{Binding Path=Items}"> + <TextBlock Text="{Binding Name}"/> + </HierarchicalDataTemplate> + </MenuItem.ItemTemplate> + </MenuItem> + </ContextMenu> + </editors:ScriptEditor.ContextMenu> + + </editors:ScriptEditor> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> @@ -279,11 +445,17 @@ <Grid Grid.Row="2"> <!--Output & Error Tabs--> - <TabControl SelectedIndex="{Binding SelectedToolWindow,Mode=TwoWay,Converter={StaticResource EnumToIntConverter}}" ItemContainerStyle="{StaticResource FSE_TabItem_VisualStudio_Output}" TabStripPlacement="Bottom" Margin="0" Background="{StaticResource FSE_PrimaryBackgroundDarkBrush}" BorderThickness="0"> + <TabControl SelectedIndex="{Binding SelectedToolWindow,Mode=TwoWay,Converter={StaticResource EnumToIntConverter}}" ItemContainerStyle="{StaticResource FSE_TabItem_VisualStudio_Output}" TabStripPlacement="Bottom" Margin="0" Background="{StaticResource FSE_PrimaryBackgroundDarkBrush}" BorderThickness="0"> <TabItem Header="OUTPUT"> - <TextBox HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Padding="5" Style="{x:Null}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}" FontFamily="Consolas" components:TextController.Controller="{Binding Logger}" FontSize="{StaticResource FSE_SmallFontSize}" Background="{StaticResource FSE_PrimaryBackgroundDarkBrush}" BorderThickness="0" AcceptsReturn="True" IsReadOnly="True"> + <DockPanel> + <Grid DockPanel.Dock="Top" Height="28" Background="{StaticResource FSE_PrimaryBackgroundBrush}"> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontFamily="{StaticResource hand}">Output</TextBlock> + <controls:IconButton Command="{Binding ClearOutputCommand}" Height="32" Cursor="Hand" ToolTip="Clear" Width="32" Icon="DeleteEmpty" Foreground="{StaticResource FSE_GrayBrush}" HorizontalAlignment="Right" VerticalAlignment="Center" /> - </TextBox> + <Rectangle VerticalAlignment="Bottom" Stroke="Black" StrokeThickness="2" /> + </Grid> + <TextBox HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Padding="5" Style="{x:Null}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}" FontFamily="Consolas" components:TextController.Controller="{Binding Logger}" FontSize="{StaticResource FSE_SmallFontSize}" Background="{StaticResource FSE_PrimaryBackgroundDarkBrush}" BorderThickness="0" AcceptsReturn="True" IsReadOnly="True" TextWrapping="Wrap" /> + </DockPanel> </TabItem> <TabItem> <TabItem.Header> @@ -292,21 +464,86 @@ <Run>(</Run><Run Text="{Binding CompilationErrors.Count,Mode=OneWay}"></Run><Run>)</Run> </TextBlock> </TabItem.Header> - <DataGrid ItemsSource="{Binding CompilationErrors}" Style="{StaticResource FSE_LogsGridStyle}" CellStyle="{StaticResource FSE_LogsGridCellStyle}" HorizontalGridLinesBrush="{StaticResource FSE_PrimaryBackgroundBrush}" AutoGenerateColumns="False"> - <DataGrid.Columns> - <DataGridTemplateColumn Width="40"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <material:PackIcon HorizontalAlignment="Center" VerticalAlignment="Center" Kind="Alert" Foreground="{StaticResource FSE_ErrorBrush}" /> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - <DataGridTextColumn Header="DESCRIPTION" Binding="{Binding Message}" Width="1*" /> - <DataGridTextColumn Header="FILE" Binding="{Binding File}" /> - <DataGridTextColumn Header="LINE" Binding="{Binding Line}" /> - <DataGridTextColumn Header="COL" Binding="{Binding Column}" /> - </DataGrid.Columns> - </DataGrid> + <DockPanel> + <Grid DockPanel.Dock="Top" Height="28" Background="{StaticResource FSE_PrimaryBackgroundBrush}"> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontFamily="{StaticResource hand}">Errors</TextBlock> + + <Rectangle VerticalAlignment="Bottom" Stroke="Black" StrokeThickness="2" /> + </Grid> + <DataGrid ItemsSource="{Binding CompilationErrors}" + Style="{StaticResource FSE_LogsGridStyle}" + CellStyle="{StaticResource FSE_LogsGridCellStyle}" + HorizontalGridLinesBrush="{StaticResource FSE_PrimaryBackgroundBrush}" + helpers:DataGridHelper.DoubleClickCommand="{Binding HighlightErrorCommand}" + AutoGenerateColumns="False"> + <DataGrid.Columns> + <DataGridTemplateColumn Width="40"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <material:PackIcon HorizontalAlignment="Center" VerticalAlignment="Center" Kind="Alert" Foreground="{StaticResource FSE_ErrorBrush}" /> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTextColumn Header="DESCRIPTION" Binding="{Binding Message}" Width="1*" /> + <DataGridTextColumn Header="FILE" Binding="{Binding File}" /> + <DataGridTextColumn Header="LINE" Binding="{Binding Line}" /> + <DataGridTextColumn Header="COL" Binding="{Binding Column}" /> + </DataGrid.Columns> + </DataGrid> + </DockPanel> + </TabItem> + <TabItem> + <TabItem.Header> + <TextBlock> + <Run>INPUTS</Run> + <Run>(</Run><Run Text="{Binding Project.Inputs.Count,Mode=OneWay}"></Run><Run>)</Run> + </TextBlock> + </TabItem.Header> + + <DockPanel> + <Grid DockPanel.Dock="Top" Height="28" Background="{StaticResource FSE_PrimaryBackgroundBrush}"> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontFamily="{StaticResource hand}">Inputs</TextBlock> + <controls:IconButton FontSize="{StaticResource FSE_SmallFontSize}" VerticalAlignment="Center" HorizontalAlignment="Right" Command="{Binding AddProjectInputCommand}" Icon="Add" Foreground="{StaticResource FSE_GreenBrush}" Cursor="Hand" ToolTip="Add input">Add Input</controls:IconButton> + <Rectangle VerticalAlignment="Bottom" Stroke="Black" StrokeThickness="2" /> + </Grid> + <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto"> + <StackPanel HorizontalAlignment="Left" TextElement.Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> + <ItemsControl ItemsSource="{Binding Project.Inputs}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <WrapPanel Orientation="Horizontal" IsItemsHost="True" /> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <Grid> + <Line Stroke="{StaticResource FSE_BorderBrush}" X1="16" Y1="45" X2="199" Y2="151" /> + <DockPanel Margin="15 15 50 15"> + <material:PackIcon Kind="Key" VerticalAlignment="Top" Margin="0 18 0 0" /> + <controls:IconButton VerticalAlignment="Top" DockPanel.Dock="Right" Width="32" Height="32" Margin="10 10 0 0" Icon="Close" Foreground="{StaticResource FSE_RedBrush}" ToolTip="Delete input" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveProjectInputCommand}" CommandParameter="{Binding}"></controls:IconButton> + <DockPanel Margin="10 0 0 0" Width="100" VerticalAlignment="Top"> + <TextBlock Margin="2 0 0 2" DockPanel.Dock="Top" FontSize="{StaticResource FSE_SmallerFontSize}">Key</TextBlock> + <TextBox Style="{StaticResource FSE_Rounded_Corners_TextBox}" Text="{Binding Key}"></TextBox> + </DockPanel> + <material:PackIcon Kind="Equal" VerticalAlignment="Top" Margin="20 20 20 0" /> + <StackPanel Width="400"> + <TextBlock Margin="2 0 0 2" FontSize="{StaticResource FSE_SmallerFontSize}">Value</TextBlock> + <TextBox Style="{StaticResource FSE_Rounded_Corners_TextBox}" Text="{Binding Value}"></TextBox> + + <TextBlock Margin="2 10 0 2" FontSize="{StaticResource FSE_SmallerFontSize}">Display Name</TextBlock> + <TextBox Style="{StaticResource FSE_Rounded_Corners_TextBox}" Text="{Binding DisplayName}"></TextBox> + + <TextBlock Margin="2 10 0 2" FontSize="{StaticResource FSE_SmallerFontSize}">Description</TextBlock> + <TextBox Style="{StaticResource FSE_Rounded_Corners_TextBox}" Text="{Binding Description}"></TextBox> + </StackPanel> + </DockPanel> + </Grid> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> + </ScrollViewer> + </DockPanel> </TabItem> <TabItem> <TabItem.Header> @@ -315,58 +552,76 @@ <Run>(</Run><Run Text="{Binding Results.Count,Mode=OneWay}"></Run><Run>)</Run> </TextBlock> </TabItem.Header> - <DataGrid ItemsSource="{Binding Results}" Style="{StaticResource FSE_LogsGridStyle}" CellStyle="{StaticResource FSE_LogsGridCellStyle}" HorizontalGridLinesBrush="{StaticResource FSE_PrimaryBackgroundBrush}" AutoGenerateColumns="False"> - <DataGrid.Columns> - <DataGridTemplateColumn Width="40"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <material:PackIcon HorizontalAlignment="Center" VerticalAlignment="Center"> - <material:PackIcon.Style> - <Style TargetType="material:PackIcon"> - <Setter Property="Kind" Value="Check"></Setter> - <Setter Property="Foreground" Value="{StaticResource FSE_SuccessBrush}"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Type}" Value="Warning"> - <Setter Property="Kind" Value="Alert"></Setter> - <Setter Property="Foreground" Value="{StaticResource FSE_WarningBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding Type}" Value="Failed"> - <Setter Property="Kind" Value="Alert"></Setter> - <Setter Property="Foreground" Value="{StaticResource FSE_ErrorBrush}"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </material:PackIcon.Style> - </material:PackIcon> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - <DataGridTextColumn Header="NAME" Binding="{Binding Name}" /> - <DataGridTextColumn Header="VALUE" Binding="{Binding Value}" Width="1*" /> - </DataGrid.Columns> - </DataGrid> - </TabItem> - <TabItem Header="PUBLISH"> + <DockPanel> + <Grid DockPanel.Dock="Top" Height="28" Background="{StaticResource FSE_PrimaryBackgroundBrush}"> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontFamily="{StaticResource hand}">Results</TextBlock> + <Rectangle VerticalAlignment="Bottom" Stroke="Black" StrokeThickness="2" /> + </Grid> + <DataGrid ItemsSource="{Binding Results}" Style="{StaticResource FSE_LogsGridStyle}" CellStyle="{StaticResource FSE_LogsGridCellStyle}" HorizontalGridLinesBrush="{StaticResource FSE_PrimaryBackgroundBrush}" AutoGenerateColumns="False"> + <DataGrid.Columns> + <DataGridTemplateColumn Width="40"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <material:PackIcon HorizontalAlignment="Center" VerticalAlignment="Center"> + <material:PackIcon.Style> + <Style TargetType="material:PackIcon"> + <Setter Property="Kind" Value="Check"></Setter> + <Setter Property="Foreground" Value="{StaticResource FSE_SuccessBrush}"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Type}" Value="Warning"> + <Setter Property="Kind" Value="Alert"></Setter> + <Setter Property="Foreground" Value="{StaticResource FSE_WarningBrush}"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Type}" Value="Failed"> + <Setter Property="Kind" Value="Alert"></Setter> + <Setter Property="Foreground" Value="{StaticResource FSE_ErrorBrush}"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </material:PackIcon.Style> + </material:PackIcon> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTextColumn Header="NAME" Binding="{Binding Name}" /> + <DataGridTextColumn Header="VALUE" Binding="{Binding Value}" Width="1*" /> + </DataGrid.Columns> + </DataGrid> + </DockPanel> </TabItem> </TabControl> </Grid> </Grid> - <GridSplitter Grid.Column="1" Width="5" HorizontalAlignment="Center" VerticalAlignment="Stretch" Margin="0 30" /> + <GridSplitter Grid.Column="2" Width="5" HorizontalAlignment="Center" VerticalAlignment="Stretch" Margin="0 33 0 30" /> - <Grid Grid.Column="2"> + <Grid Grid.Column="3"> <Grid Margin="0 33 0 29"> <!--Project Explorer--> <DockPanel Background="{StaticResource FSE_PrimaryBackgroundDarkBrush}"> <Border DockPanel.Dock="Top" Padding="5" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" BorderThickness="0 2 0 0" BorderBrush="{StaticResource FSE_PrimaryAccentBrush}"> - <TextBlock>PROJECT EXPLORER</TextBlock> + <TextBlock FontWeight="SemiBold">PROJECT EXPLORER</TextBlock> </Border> <ScrollViewer Padding="10" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> <StackPanel> <DockPanel> - <material:PackIcon Kind="ClockFast" /> - <TextBlock Margin="5 0 0 0" Text="{Binding Project.Name}"></TextBlock> + <Image Source="../Images/project_small.png" Width="20" RenderOptions.BitmapScalingMode="Fant" /> + <material:PackIcon DockPanel.Dock="Right" Kind="Eye" VerticalAlignment="Center" Visibility="{Binding PublishedTestProject,Converter={StaticResource IsNullToVisibilityConverter}}"> + <material:PackIcon.Style> + <Style TargetType="material:PackIcon"> + <Setter Property="Foreground" Value="{StaticResource FSE_GrayBrush}"></Setter> + <Setter Property="ToolTip" Value="Suppressed"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding PublishedTestProject.IsVisible}" Value="True"> + <Setter Property="Foreground" Value="{StaticResource FSE_GreenBrush}"></Setter> + <Setter Property="ToolTip" Value="Published"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </material:PackIcon.Style> + </material:PackIcon> + <TextBlock Margin="5 0 0 0" Text="{Binding Project.Name}" VerticalAlignment="Center"></TextBlock> </DockPanel> <DockPanel Margin="5 10 0 0"> @@ -381,7 +636,7 @@ <Setter Property="ContextMenu"> <Setter.Value> <ContextMenu> - <MenuItem Header="Remove" Command="{Binding Source={StaticResource proxy},Path=Data.RemoveReferenceAssemblyCommand}" CommandParameter="{Binding}"> + <MenuItem MinWidth="180" Header="Remove" Command="{Binding Source={StaticResource proxy},Path=Data.RemoveReferenceAssemblyCommand}" CommandParameter="{Binding}"> <MenuItem.Icon> <material:PackIcon Kind="Delete" Foreground="{StaticResource FSE_RedBrush}" /> </MenuItem.Icon> @@ -401,10 +656,28 @@ </ListBox.ItemTemplate> </ListBox> - <ListBox Margin="5 5 0 0" ItemsSource="{Binding Project.Scripts}" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled"> + <ListBox Margin="5 5 0 0" ItemsSource="{Binding Project.Scripts,Converter={StaticResource ObservableCollectionToViewSourceConverter},ConverterParameter='Name'}" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}"> <EventSetter Event="PreviewMouseDoubleClick" Handler="OnScriptItemDoubleClick"></EventSetter> + + <Setter Property="ContextMenu"> + <Setter.Value> + <ContextMenu> + <MenuItem MinWidth="180" IsEnabled="{Binding IsEntryPoint,Converter={StaticResource BooleanInverseConverter}}" Header="Rename" Command="{Binding Source={StaticResource proxy},Path=Data.RenameLibraryCommand}" CommandParameter="{Binding}"> + <MenuItem.Icon> + <material:PackIcon Kind="Rename" /> + </MenuItem.Icon> + </MenuItem> + <Separator/> + <MenuItem MinWidth="180" IsEnabled="{Binding IsEntryPoint,Converter={StaticResource BooleanInverseConverter}}" Header="Delete" Command="{Binding Source={StaticResource proxy},Path=Data.DeleteLibraryCommand}" CommandParameter="{Binding}"> + <MenuItem.Icon> + <material:PackIcon Kind="Delete" Foreground="{StaticResource FSE_RedBrush}" /> + </MenuItem.Icon> + </MenuItem> + </ContextMenu> + </Setter.Value> + </Setter> </Style> </ListBox.ItemContainerStyle> <ListBox.ItemTemplate> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestDesignerView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestDesignerView.xaml.cs index ab9289ddb..b91ede833 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestDesignerView.xaml.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestDesignerView.xaml.cs @@ -12,21 +12,24 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.FSE.Stubs.Contracts; using Tango.FSE.Stubs.ViewModels; using Tango.Scripting.Basic; +using Tango.Scripting.Editors; namespace Tango.FSE.Stubs.Views { /// <summary> /// Interaction logic for TestDesignerView.xaml /// </summary> - public partial class TestDesignerView : UserControl + public partial class TestDesignerView : UserControl, ITestDesignerView { private TestDesignerViewVM _vm; public TestDesignerView() { InitializeComponent(); + this.Register<ITestDesignerView>(); Loaded += (_, __) => _vm = DataContext as TestDesignerViewVM; } @@ -34,5 +37,26 @@ namespace Tango.FSE.Stubs.Views { _vm.OpenScript((sender as FrameworkElement).DataContext as Script); } + + private ScriptEditor GetCurrentEditor() + { + var editor = tabControl.FindVisualChildren<ScriptEditor>().FirstOrDefault(x => x.IsVisible); + return editor; + } + + public void FormatCode() + { + GetCurrentEditor()?.FormatCode(); + } + + public void HighlightCode(int position, int length) + { + GetCurrentEditor()?.Highlight(position, length); + } + + public void InsertCode(string code) + { + GetCurrentEditor()?.InsertCode(code); + } } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerCatalogView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerCatalogView.xaml new file mode 100644 index 000000000..2af7253ae --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerCatalogView.xaml @@ -0,0 +1,105 @@ +<UserControl x:Class="Tango.FSE.Stubs.Views.TestRunnerCatalogView" + 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:shapes="clr-namespace:Tango.SharedUI.Shapes;assembly=Tango.SharedUI" + xmlns:global="clr-namespace:Tango.FSE.Stubs" + xmlns:vm="clr-namespace:Tango.FSE.Stubs.ViewModels" + xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:local="clr-namespace:Tango.FSE.Stubs.Views" + xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:TestRunnerViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.TestRunnerViewVM}" d:DesignStyle="{StaticResource FSE_User_Control_Designer}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> + <Grid Margin="10"> + <DockPanel> + <Grid Margin="20 20 0 0" Height="200" VerticalAlignment="Top" DockPanel.Dock="Top"> + <DockPanel> + <Image Margin="0 10 0 0" Source="../Images/test_runner.png" Stretch="None" VerticalAlignment="Top" RenderOptions.BitmapScalingMode="Fant" /> + <StackPanel Margin="20 0 0 0"> + <TextBlock FontSize="{StaticResource FSE_ModuleHeaderFontSize}" Foreground="{StaticResource FSE_PrimaryAccentBrush}">Test Runner</TextBlock> + <TextBlock Margin="0 5 0 0" Foreground="{StaticResource FSE_GrayBrush}" LineHeight="18"> + <Run>Welcome to the test runner.</Run> + <LineBreak/> + <Run>Below is a collection of machine tests that can be executed independently.</Run> + <LineBreak/> + <Run>Each test can yield one or more test results, and may require you to provide some input before execution.</Run> + <LineBreak/> + <Run>Pressing the 'run' button on the desired test will navigate you to the test execution screen.</Run> + </TextBlock> + </StackPanel> + </DockPanel> + </Grid> + <Grid Margin="0 20 0 0"> + <ListBox Style="{StaticResource FSE_BlankListBox}" ItemsSource="{Binding PublishedTestProjects}"> + <ListBox.ItemsPanel> + <ItemsPanelTemplate> + <WrapPanel Orientation="Horizontal" IsItemsHost="True" /> + </ItemsPanelTemplate> + </ListBox.ItemsPanel> + <ListBox.ItemTemplate> + <DataTemplate> + <Border> + <Border.Effect> + <DropShadowEffect ShadowDepth="0" BlurRadius="10" Color="{StaticResource FSE_PrimaryBackgroundDarkColor}" Opacity="0.5" /> + </Border.Effect> + <Border x:Name="border" Margin="10" Width="350" Height="200" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" CornerRadius="5" BorderThickness="0 1 1 0"> + <Border.BorderBrush> + <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> + <GradientStop Color="{StaticResource FSE_BorderColor}" Offset="0" /> + <GradientStop Color="Transparent" Offset="1" /> + </LinearGradientBrush> + </Border.BorderBrush> + + <Border.Clip> + <RectangleGeometry RadiusX="5" RadiusY="5" Rect="0,0,350,200" /> + </Border.Clip> + <Grid> + <Polygon Fill="{StaticResource FSE_PrimaryBackgroundLighterBrush}" Points="0,0 150,0 0,170"></Polygon> + <DockPanel> + <Border CornerRadius="0 0 5 5" Padding="8" BorderThickness="0 1 0 0" BorderBrush="{StaticResource FSE_BorderBrush}" DockPanel.Dock="Bottom" Background="{StaticResource FSE_PrimaryBackgroundDarkBrush}" > + <Button Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RunProjectCommand}" CommandParameter="{Binding}" Height="30" Width="140" HorizontalContentAlignment="Stretch" HorizontalAlignment="Right" Style="{StaticResource FSE_RaisedButton_Dark_Hover}"> + <DockPanel> + <material:PackIcon Kind="Play" Height="24" Width="24" Foreground="{StaticResource FSE_GreenBrush}" /> + <TextBlock Margin="20 2 0 0" VerticalAlignment="Center">RUN</TextBlock> + </DockPanel> + </Button> + </Border> + <DockPanel Margin="10"> + <Image VerticalAlignment="Top" Source="../Images/project.png" Width="48" RenderOptions.BitmapScalingMode="Fant" /> + <DockPanel Margin="10 0 0 0"> + <TextBlock Text="{Binding Name}" DockPanel.Dock="Top" TextWrapping="Wrap" FontSize="{StaticResource FSE_LargerFontSize}"> + <TextBlock.Style> + <Style TargetType="TextBlock"> + <Setter Property="Foreground" Value="{StaticResource FSE_PrimaryForegroundBrush}"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding ElementName=border,Path=IsMouseOver}" Value="True"> + <Setter Property="Foreground" Value="{StaticResource FSE_PrimaryAccentBrush}"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBlock.Style> + </TextBlock> + <TextBlock Margin="0 5 0 0" Foreground="{StaticResource FSE_GrayBrush}" TextWrapping="Wrap" Text="{Binding Description}" /> + </DockPanel> + </DockPanel> + </DockPanel> + + <controls:IconButton HorizontalAlignment="Right" VerticalAlignment="Top" Cursor="Hand" Width="30" Height="30" Icon="Cogs" ToolTip="Edit this project in Test Designer" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.EditProjectCommand}" CommandParameter="{Binding}" /> + </Grid> + </Border> + </Border> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + + <Grid Background="Transparent" Visibility="{Binding IsLoadingProjects,Converter={StaticResource BooleanToVisibilityConverter}}"> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> + <ProgressBar HorizontalAlignment="Center" IsIndeterminate="{Binding IsLoadingProjects}" Style="{StaticResource FSE_CircularProgressBar}" Width="150" Height="150" /> + <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0">Loading tests collection...</TextBlock> + </StackPanel> + </Grid> + </Grid> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerCatalogView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerCatalogView.xaml.cs new file mode 100644 index 000000000..ddc08aaed --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerCatalogView.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.FSE.Stubs.Views +{ + /// <summary> + /// Interaction logic for TestRunnerCatalogView.xaml + /// </summary> + public partial class TestRunnerCatalogView : UserControl + { + public TestRunnerCatalogView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerExecutionView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerExecutionView.xaml new file mode 100644 index 000000000..53c0bff56 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerExecutionView.xaml @@ -0,0 +1,152 @@ +<UserControl x:Class="Tango.FSE.Stubs.Views.TestRunnerExecutionView" + 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.FSE.Stubs" + xmlns:vm="clr-namespace:Tango.FSE.Stubs.ViewModels" + xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:local="clr-namespace:Tango.FSE.Stubs.Views" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" d:DesignStyle="{StaticResource FSE_User_Control_Designer}" d:DataContext="{d:DesignInstance Type=vm:TestRunnerViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.TestRunnerViewVM}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> + + <Grid> + <Ellipse Fill="{StaticResource FSE_PrimaryBackgroundDarkBrush}" Opacity="0.7" Width="2050" Margin="-1500 -500 0 -500" /> + <Grid Margin="10"> + <DockPanel> + <Grid Margin="20 20 0 0" Height="100" VerticalAlignment="Top" DockPanel.Dock="Top"> + <DockPanel> + <Grid> + <Image Margin="0 10 0 0" Source="../Images/project.png" Stretch="None" VerticalAlignment="Top" RenderOptions.BitmapScalingMode="Fant" /> + <material:PackIcon Margin="0 0 -15 15" Kind="Play" Foreground="{StaticResource FSE_GreenBrush}" Width="48" Height="48" VerticalAlignment="Bottom" HorizontalAlignment="Right" /> + </Grid> + <StackPanel Margin="20 0 0 0"> + <TextBlock FontSize="{StaticResource FSE_ModuleHeaderFontSize}" Foreground="{StaticResource FSE_PrimaryAccentBrush}" Text="{Binding RunningTestProject.Name}"></TextBlock> + <TextBlock Margin="0 5 0 0" Foreground="{StaticResource FSE_GrayBrush}" LineHeight="18" Text="{Binding RunningTestProject.Description}"></TextBlock> + </StackPanel> + </DockPanel> + </Grid> + <Grid Margin="105 0 0 0"> + <ScrollViewer HorizontalScrollBarVisibility="Disabled"> + <StackPanel> + <StackPanel> + <StackPanel IsEnabled="{Binding ProjectRunner.CanRun}" Margin="0 40 0 0" Visibility="{Binding HasTestInputs,Converter={StaticResource BooleanToVisibilityConverter},FallbackValue='Visible',TargetNullValue='Visible'}"> + <TextBlock FontSize="{StaticResource FSE_LargeFontSize}" FontWeight="SemiBold" Foreground="{StaticResource FSE_PrimaryAccentBrush}">Inputs</TextBlock> + <!--<Rectangle Margin="0 2 0 0" Stroke="{StaticResource FSE_BorderBrush}" StrokeDashArray="5" />--> + <TextBlock Margin="0 5 0 0" Foreground="{StaticResource FSE_GrayBrush}" Text="Please provide the necessary inputs or leave as defaults."></TextBlock> + + <ItemsControl Margin="0 10 0 0" ItemsSource="{Binding RunningTestProject.Inputs}"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <DockPanel Margin="0 10 20 10"> + <material:PackIcon VerticalAlignment="Center" Kind="Pen" Width="32" Height="32" /> + <StackPanel Margin="10 0 0 0"> + <TextBlock FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}" Text="{Binding DisplayName,FallbackValue='N/A'}"></TextBlock> + <StackPanel Orientation="Horizontal"> + <TextBox HorizontalAlignment="Left" Style="{StaticResource FSE_Rounded_Corners_TextBox}" Width="250" Padding="5" Margin="0 2 0 0" Text="{Binding Value,UpdateSourceTrigger=PropertyChanged}"></TextBox> + <material:PackIcon VerticalAlignment="Center" Margin="20 0 0 0" Foreground="{StaticResource FSE_GrayBrush}" Kind="InfoCircleOutline" /> + <TextBlock Margin="5 0 0 0" FontSize="{StaticResource FSE_SmallFontSize}" VerticalAlignment="Center" Foreground="{StaticResource FSE_GrayBrush}" Text="{Binding Description,FallbackValue='No description provided'}"></TextBlock> + </StackPanel> + </StackPanel> + </DockPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> + + <StackPanel HorizontalAlignment="Left" Width="1050" Margin="0 20 0 0"> + <DockPanel> + <Grid Margin="20 0 0 0" DockPanel.Dock="Right" > + <Button Command="{Binding StartProjectCommand}" Visibility="{Binding ProjectRunner.IsRunning,Converter={StaticResource BooleanToVisibilityInverseConverter}}" IsEnabled="{Binding ProjectRunner.CanRun}" Style="{StaticResource FSE_RaisedButton_Dark_Hover}" Width="200" Height="50"> + <DockPanel> + <material:PackIcon Kind="Play" Foreground="{StaticResource FSE_GreenBrush}" Width="24" Height="24" /> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">START</TextBlock> + </DockPanel> + </Button> + <Button Command="{Binding StopProjectCommand}" Visibility="{Binding ProjectRunner.IsRunning,Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource FSE_RaisedButton_Dark_Hover}" Width="200" Height="50"> + <DockPanel> + <material:PackIcon Kind="Stop" Foreground="{StaticResource FSE_RedBrush}" Width="24" Height="24" /> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">STOP</TextBlock> + </DockPanel> + </Button> + </Grid> + <StackPanel VerticalAlignment="Bottom"> + <TextBlock Text="{Binding Status}"></TextBlock> + <ProgressBar Margin="0 5 0 0" Height="10" IsIndeterminate="{Binding ProjectRunner.IsRunning}" /> + </StackPanel> + </DockPanel> + </StackPanel> + </StackPanel> + <StackPanel Margin="0 100 0 0" HorizontalAlignment="Left" Visibility="{Binding ProjectRunner.State,Converter={StaticResource EnumToVisibilityConverter},ConverterParameter='Failed'}"> + <TextBlock FontSize="{StaticResource FSE_LargeFontSize}" FontWeight="SemiBold" Foreground="{StaticResource FSE_RedBrush}">Test Failed</TextBlock> + <TextBlock Margin="0 20 0 0">The test has failed to complete with the following error:</TextBlock> + <TextBlock Text="{Binding FailedError}" Margin="0 5 0 0" FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}" TextWrapping="Wrap"></TextBlock> + </StackPanel> + <StackPanel> + <StackPanel.Style> + <Style TargetType="StackPanel"> + <Setter Property="Opacity" Value="0"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding ProjectRunner.State}" Value="Completed"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="00:00:0.5" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="Opacity" To="0" Duration="00:00:0.5" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </StackPanel.Style> + <StackPanel Margin="0 100 0 0" HorizontalAlignment="Left" Width="1050"> + <TextBlock FontSize="{StaticResource FSE_LargeFontSize}" FontWeight="SemiBold" Foreground="{StaticResource FSE_PrimaryAccentBrush}">Results</TextBlock> + <!--<Rectangle Margin="0 2 0 0" Stroke="{StaticResource FSE_BorderBrush}" StrokeDashArray="5" />--> + </StackPanel> + <Grid> + <ItemsControl ItemsSource="{Binding Results}" HorizontalAlignment="Left" Margin="0 20 0 0"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <DockPanel Margin="10"> + <material:PackIcon HorizontalAlignment="Center" VerticalAlignment="Center" Width="42" Height="42"> + <material:PackIcon.Style> + <Style TargetType="material:PackIcon"> + <Setter Property="Kind" Value="Check"></Setter> + <Setter Property="Foreground" Value="{StaticResource FSE_SuccessBrush}"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Type}" Value="Warning"> + <Setter Property="Kind" Value="Alert"></Setter> + <Setter Property="Foreground" Value="{StaticResource FSE_WarningBrush}"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Type}" Value="Failed"> + <Setter Property="Kind" Value="Alert"></Setter> + <Setter Property="Foreground" Value="{StaticResource FSE_ErrorBrush}"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </material:PackIcon.Style> + </material:PackIcon> + <StackPanel Margin="15 0 0 0" VerticalAlignment="Center"> + <TextBlock Text="{Binding Name}" ></TextBlock> + <TextBlock Margin="0 2 0 0" FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}" Text="{Binding Value}"></TextBlock> + </StackPanel> + </DockPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </Grid> + </StackPanel> + </StackPanel> + </ScrollViewer> + </Grid> + </DockPanel> + </Grid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerExecutionView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerExecutionView.xaml.cs new file mode 100644 index 000000000..a232547f5 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerExecutionView.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.FSE.Stubs.Views +{ + /// <summary> + /// Interaction logic for TestRunnerExecutionView.xaml + /// </summary> + public partial class TestRunnerExecutionView : UserControl + { + public TestRunnerExecutionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerView.xaml index daf1d2ac0..704ab229a 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerView.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerView.xaml @@ -3,12 +3,20 @@ 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.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:global="clr-namespace:Tango.FSE.Stubs" xmlns:vm="clr-namespace:Tango.FSE.Stubs.ViewModels" xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:local="clr-namespace:Tango.FSE.Stubs.Views" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:TestRunnerViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.TestRunnerViewVM}" Background="{StaticResource FSE_PrimaryBackgroundBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> + d:DesignHeight="1080" d:DesignWidth="1920" d:DataContext="{d:DesignInstance Type=vm:TestRunnerViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.TestRunnerViewVM}" Background="{StaticResource FSE_PrimaryBackgroundBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> + + <Grid> + <Image Source="../Images/test_tools.png" Stretch="None" HorizontalAlignment="Right" VerticalAlignment="Top" Opacity="0.05" /> + <controls:NavigationControl TransitionType="Slide" TransitionDuration="00:00:0.2" SelectedObject="{Binding SelectedView}"> + <local:TestRunnerCatalogView/> + <local:TestRunnerExecutionView/> + </controls:NavigationControl> + </Grid> - </UserControl> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.BL/CacheEntities/CachedPublishedTestProject.cs b/Software/Visual_Studio/FSE/Tango.FSE.BL/CacheEntities/CachedPublishedTestProject.cs new file mode 100644 index 000000000..622df70c7 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.BL/CacheEntities/CachedPublishedTestProject.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.ActionLogs; +using Tango.BL.DTO; + +namespace Tango.FSE.BL.CacheEntities +{ + public class CachedPublishedTestProject : PublishedTestProjectDTO + { + [ActionLogIgnore] + public List<PublishedTestProjectsVersionDTO> PublishedTestProjectsVersions { get; set; } + + public CachedPublishedTestProject() + { + PublishedTestProjectsVersions = new List<PublishedTestProjectsVersionDTO>(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.BL/FSEServicesContainer.cs b/Software/Visual_Studio/FSE/Tango.FSE.BL/FSEServicesContainer.cs index 1c2d5901a..50b9a7177 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.BL/FSEServicesContainer.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.BL/FSEServicesContainer.cs @@ -48,6 +48,11 @@ namespace Tango.FSE.BL public TechComponentsService TechComponentsService { get; set; } /// <summary> + /// Gets or sets the published test projects service. + /// </summary> + public PublishedTestProjectsService PublishedTestProjectsService { get; set; } + + /// <summary> /// Initializes a new instance of the <see cref="FSEServicesContainer"/> class. /// </summary> /// <param name="authentication">The authentication.</param> @@ -60,6 +65,7 @@ namespace Tango.FSE.BL BugReportingService = new BugReportingService(); TangoVersionsService = new TangoVersionsService(); TechComponentsService = new TechComponentsService(); + PublishedTestProjectsService = new PublishedTestProjectsService(); } } } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.BL/Services/PublishedTestProjectsService.cs b/Software/Visual_Studio/FSE/Tango.FSE.BL/Services/PublishedTestProjectsService.cs new file mode 100644 index 000000000..ca6ea7c52 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.BL/Services/PublishedTestProjectsService.cs @@ -0,0 +1,222 @@ +using System; +using System.Collections.Generic; +using System.Data.Entity; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL; +using Tango.BL.Entities; +using Tango.FSE.BL.CacheEntities; +using Z.EntityFramework.Plus; + +namespace Tango.FSE.BL.Services +{ + public class PublishedTestProjectsService : FSEServiceBase + { + private const string PUBLISHED_TEST_PROJECTS_COLLECTION = "PublishedTestProjects"; + + private MemoryCacheDictionary<String, CachedPublishedTestProject> _projectsCache; + + public PublishedTestProjectsService() + { + _projectsCache = MemoryCache.GetOrCreateCache<String, CachedPublishedTestProject>(PUBLISHED_TEST_PROJECTS_COLLECTION); + } + + public Task<List<PublishedTestProject>> GetPublishedTestProjects(bool visibleOnly = true) + { + return DataResolver<List<PublishedTestProject>>.Builder.New() + .ConfigureCascade(DataResolverNode.InMemoryCache, DataResolverNode.Online, DataResolverNode.DiskCache) + .InMemoryCache((context) => + { + var projects = _projectsCache.ToList().Where(x => x.IsVisible || !visibleOnly).Select(x => x.ToObservable()).ToList(); + + if (projects.Count == 0) + { + throw new IndexOutOfRangeException("The memory cache did not contain any test projects."); + } + + return projects; + }) + .Online((context) => + { + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + var select = db.PublishedTestProjects + .Where(x => x.IsVisible || !visibleOnly) + .Include(x => x.PublishedTestProjectsVersions) + .Select(x => new + { + Project = x, + LatestVersion = x.PublishedTestProjectsVersions.OrderByDescending(v => v.Version).FirstOrDefault() + }).ToList(); + + List<PublishedTestProject> projects = new List<PublishedTestProject>(); + + foreach (var p in select) + { + PublishedTestProject project = p.Project; + projects.Add(project); + } + + using (var cache = DiskCache.CreateContext()) + { + try + { + var collection = cache.GetCollection<CachedPublishedTestProject>(PUBLISHED_TEST_PROJECTS_COLLECTION); + + foreach (var project in projects) + { + var cachedProject = CachedPublishedTestProject.FromObservable<CachedPublishedTestProject>(project); + _projectsCache.Put(cachedProject.Guid, cachedProject); + + collection.Upsert(cachedProject); + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error caching published test projects."); + } + } + + return projects; + } + }) + .DiskCache((context) => + { + using (var cache = DiskCache.CreateContext()) + { + var collection = cache.GetCollection<CachedPublishedTestProject>(PUBLISHED_TEST_PROJECTS_COLLECTION); + + var cachedProjects = collection + .Find(x => x.IsVisible || !visibleOnly) + .ToList(); + + foreach (var cachedProject in cachedProjects) + { + _projectsCache.Put(cachedProject.Guid, cachedProject); + } + + return cachedProjects.Select(x => x.ToObservable()).ToList(); + } + }) + .BuildExecuteAsync(); + } + + public Task<PublishedTestProject> PublishTestProject(String projectGuid, String name, String description, String projectJson) + { + return Task.Factory.StartNew<PublishedTestProject>(() => + { + if (!ConnectivityProvider.CheckOnline()) + { + throw new InternetConnectionException(); + } + + if (!name.IsNotNullOrEmpty()) + { + throw new ArgumentException("Cannot publish a project with an empty name."); + } + + PublishedTestProject project = null; + + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + int version = 1; + + bool insert = false; + + if (projectGuid == null) + { + insert = true; + project = new PublishedTestProject(); + } + else + { + project = db.PublishedTestProjects.SingleOrDefault(x => x.Guid == projectGuid); + + int? lastVersion = db.PublishedTestProjectsVersions.Where(x => x.PublishedTestProjectGuid == project.Guid).Select(x => x.Version).OrderByDescending(x => x).FirstOrDefault(); + + if (lastVersion != null) + { + version = lastVersion.Value + 1; + } + } + + project.Name = name; + project.Description = description; + project.PublishDate = DateTime.UtcNow; + project.IsVisible = true; + + PublishedTestProjectsVersion projectVersion = new PublishedTestProjectsVersion(); + projectVersion.Author = CurrentUser.Contact.FullName; + projectVersion.Version = version; + projectVersion.ProjectJsonString = projectJson; + projectVersion.PublishedTestProject = project; + projectVersion.PublishedTestProjectGuid = project.Guid; + + project.PublishedTestProjectsVersions.Add(projectVersion); + + if (insert) + { + db.SingleInsert(project); + } + else + { + db.SingleUpdate(project); + } + + db.SingleInsert(projectVersion); + + var versionsCount = db.PublishedTestProjectsVersions.Where(x => x.PublishedTestProjectGuid == project.Guid).Count(); + + if (versionsCount > 10) + { + var firstVersion = db.PublishedTestProjectsVersions.Where(x => x.PublishedTestProjectGuid == project.Guid).OrderBy(x => x.Version).First(); + db.SingleDelete(firstVersion); + } + + using (var cache = DiskCache.CreateContext()) + { + var cachedProject = CachedPublishedTestProject.FromObservable<CachedPublishedTestProject>(project); + + var collection = cache.GetCollection<CachedPublishedTestProject>(PUBLISHED_TEST_PROJECTS_COLLECTION); + + collection.Upsert(cachedProject); + + _projectsCache.Put(project.Guid, cachedProject); + } + + return project; + } + }); + } + + public Task<PublishedTestProject> UnPublishTestProject(PublishedTestProject project) + { + return Task.Factory.StartNew<PublishedTestProject>(() => + { + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + db.PublishedTestProjects.Where(x => x.Guid == project.Guid).Update(x => new PublishedTestProject() { IsVisible = false }); + + project.IsVisible = false; + + using (var cache = DiskCache.CreateContext()) + { + var collection = cache.GetCollection<CachedPublishedTestProject>(PUBLISHED_TEST_PROJECTS_COLLECTION); + var cachedProject = collection.FindOne(x => x.Guid == project.Guid); + + if (cachedProject != null) + { + cachedProject.IsVisible = false; + collection.Update(cachedProject); + } + + _projectsCache.Put(project.Guid, cachedProject); + } + + return project; + } + }); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.BL/Tango.FSE.BL.csproj b/Software/Visual_Studio/FSE/Tango.FSE.BL/Tango.FSE.BL.csproj index f0097c2f6..5dc3a6ced 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.BL/Tango.FSE.BL.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.BL/Tango.FSE.BL.csproj @@ -80,6 +80,7 @@ </Reference> </ItemGroup> <ItemGroup> + <Compile Include="CacheEntities\CachedPublishedTestProject.cs" /> <Compile Include="EntityRepositoryBase.cs" /> <Compile Include="MemoryCacheDictionary.cs" /> <Compile Include="CacheEntities\CachedBugInfoResponse.cs" /> @@ -106,6 +107,7 @@ <Compile Include="Services\BugReportingService.cs" /> <Compile Include="Services\GatewayService.cs" /> <Compile Include="Services\MachinesService.cs" /> + <Compile Include="Services\PublishedTestProjectsService.cs" /> <Compile Include="Services\TangoVersionsService.cs" /> <Compile Include="Services\TechComponentsService.cs" /> <Compile Include="Services\UsersService.cs" /> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/IconButton.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/IconButton.xaml index 571e86bcf..679fefb78 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/IconButton.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/IconButton.xaml @@ -10,7 +10,9 @@ <Setter Property="ContentTemplate"> <Setter.Value> <DataTemplate> - <Grid Background="Transparent"> + <DockPanel> + <ContentPresenter Margin="5 0 0 0" DockPanel.Dock="Right" Content="{Binding}" VerticalAlignment="Center" /> + <Grid Background="Transparent"> <material:PackIcon IsHitTestVisible="False" RenderTransformOrigin="0.5, 0.5" Kind="{Binding RelativeSource={RelativeSource AncestorType=local:IconButton},Path=Icon}" Width="Auto" Height="Auto"> <material:PackIcon.Style> <Style TargetType="material:PackIcon"> @@ -63,6 +65,7 @@ </Grid> </Canvas> </Grid> + </DockPanel> </DataTemplate> </Setter.Value> </Setter> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/ExtensionMethods/IFSEViewExtensions.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/ExtensionMethods/IFSEViewExtensions.cs new file mode 100644 index 000000000..7707100ad --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/ExtensionMethods/IFSEViewExtensions.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.DI; +using Tango.FSE.Common; + +public static class IFSEViewExtensions +{ + public static void Register<T>(this T view) where T : class, IFSEView + { + TangoIOC.Default.Register<T>(view); + } +} + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Colors.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Colors.xaml index b7e579d72..326bdf657 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Colors.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Colors.xaml @@ -11,7 +11,7 @@ <Color x:Key="FSE_GrayColor">#A0A0A0</Color> <Color x:Key="FSE_SemiTransparentColor">#76000000</Color> <Color x:Key="FSE_BorderColor">#707070</Color> - <Color x:Key="FSE_PrimaryAccentColor">#03A9F4</Color> + <Color x:Key="FSE_PrimaryAccentColor">#009FE7</Color> <Color x:Key="FSE_PrimaryAccentDarkColor">#009FE7</Color> <Color x:Key="FSE_ErrorColor">#FF4C4C</Color> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Converters.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Converters.xaml index 04d8dc416..4917f9426 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Converters.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Converters.xaml @@ -36,4 +36,5 @@ <converters:StringToOneLineConverter x:Key="StringToOneLineConverter" /> <converters:FilePathToFileNameConverter x:Key="FilePathToFileNameConverter" /> <converters:EnumToIntConverter x:Key="EnumToIntConverter" /> + <converters:ObservableCollectionToViewSourceConverter x:Key="ObservableCollectionToViewSourceConverter" /> </ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Styles.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Styles.xaml index c93eb167a..3c21cad4b 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Styles.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Styles.xaml @@ -515,7 +515,7 @@ <Setter.Value> <ControlTemplate TargetType="{x:Type TextBoxBase}"> <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True" CornerRadius="5"> - <material:Ripple HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Feedback="{StaticResource FSE_PrimaryForegroundBrush}"> + <material:Ripple material:RippleAssist.IsDisabled="{TemplateBinding IsFocused}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Feedback="{StaticResource FSE_PrimaryForegroundBrush}"> <ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/> </material:Ripple> </Border> @@ -672,4 +672,49 @@ <Setter Property="CellStyle" Value="{StaticResource LogsGridCellStyle}" /> </Style> + <Style TargetType="{x:Type ListBoxItem}" x:Key="FSE_BlankListBoxItem"> + <Setter Property="Background" Value="Transparent"/> + <Setter Property="BorderThickness" Value="0"></Setter> + <Setter Property="Foreground" Value="{StaticResource FSE_PrimaryForegroundBrush}"></Setter> + <Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter> + <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter> + <Setter Property="Padding" Value="0"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ListBoxItem}"> + <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" Background="{TemplateBinding Background}" Padding="0" SnapsToDevicePixels="true"> + <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsSelected" Value="true"> + <Setter Property="Background" TargetName="Bd" Value="Transparent"/> + </Trigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="IsSelected" Value="true"/> + <Condition Property="Selector.IsSelectionActive" Value="false"/> + </MultiTrigger.Conditions> + <Setter Property="Background" TargetName="Bd" Value="Transparent"/> + </MultiTrigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style TargetType="{x:Type ListBox}" x:Key="FSE_BlankListBox"> + <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"></Setter> + <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"></Setter> + <Setter Property="BorderThickness" Value="0"></Setter> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="ItemContainerStyle" Value="{StaticResource FSE_BlankListBoxItem}"></Setter> + </Style> + + <Style TargetType="UserControl" x:Key="FSE_User_Control_Designer"> + <Setter Property="Background" Value="{StaticResource FSE_PrimaryBackgroundBrush}"></Setter> + </Style> + </ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj index 47bc2c36f..f79bfba03 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj @@ -125,6 +125,7 @@ <Compile Include="Dialogs\FirmwareLogItemViewVM.cs" /> <Compile Include="EventTriggerActions\SetterAction.cs" /> <Compile Include="ExtensionMethods\IExternalBridgeClientExtensions.cs" /> + <Compile Include="ExtensionMethods\IFSEViewExtensions.cs" /> <Compile Include="ExtensionMethods\ViewModelExtensionMethods.cs" /> <Compile Include="FileSystem\FileSystemHandler.cs" /> <Compile Include="FileSystem\FileSystemHandlerStatus.cs" /> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Diagnostics/DefaultDiagnosticsProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Diagnostics/DefaultDiagnosticsProvider.cs index 01bfb26b2..984878f43 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Diagnostics/DefaultDiagnosticsProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Diagnostics/DefaultDiagnosticsProvider.cs @@ -1,10 +1,12 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using Tango.Core; +using Tango.Core.Threading; using Tango.FSE.Common; using Tango.FSE.Common.Connection; using Tango.FSE.Common.Diagnostics; @@ -20,8 +22,7 @@ namespace Tango.FSE.UI.Diagnostics /// <seealso cref="Tango.FSE.Common.Diagnostics.IDiagnosticsProvider" /> public class DefaultDiagnosticsProvider : ExtendedObject, IDiagnosticsProvider { - private ProducerConsumerQueue<StartDiagnosticsResponse> _diagnosticsQueue; - private Thread _queueThread; + private IntervalMessageDispatcher<StartDiagnosticsResponse> _frameDispatcher; private IMachineProvider _machineProvider; #region Events @@ -61,30 +62,18 @@ namespace Tango.FSE.UI.Diagnostics public DefaultDiagnosticsProvider(IMachineProvider machineProvider) { _machineProvider = machineProvider; - _diagnosticsQueue = new ProducerConsumerQueue<StartDiagnosticsResponse>(); - ThrottlingMode = DiagnosticsThrottlingMode.Direct; //SettingsManager.Default.GetOrCreate<FSESettings>().DiagnosticsThrottlingMode; + ThrottlingMode = SettingsManager.Default.GetOrCreate<FSESettings>().DiagnosticsThrottlingMode; machineProvider.MachineOperator.DiagnosticsDataAvailable += MachineOperator_DiagnosticsDataAvailable; - _queueThread = new Thread(QueueThreadMethod); - _queueThread.Name = "Diagnostics Provider Queue Thread"; - _queueThread.IsBackground = true; - _queueThread.Start(); + _frameDispatcher = new IntervalMessageDispatcher<StartDiagnosticsResponse>(PostDiagnostics); + _frameDispatcher.DriftCompensationInterval = (int)TimeSpan.FromSeconds(30).TotalMilliseconds; + _frameDispatcher.Start(); } #endregion #region Private Methods - private void QueueThreadMethod() - { - while (true) - { - var diagnostics = _diagnosticsQueue.BlockDequeue(); - PostDiagnostics(diagnostics); - Thread.Sleep((int)diagnostics.ElapsedMilli); - } - } - private void MachineOperator_DiagnosticsDataAvailable(object sender, StartDiagnosticsResponse diagnostics) { if (ThrottlingMode == DiagnosticsThrottlingMode.Direct) @@ -93,7 +82,8 @@ namespace Tango.FSE.UI.Diagnostics } else { - _diagnosticsQueue.BlockEnqueue(diagnostics); + _frameDispatcher.Interval = (int)diagnostics.ElapsedMilli; + _frameDispatcher.Push(diagnostics); } } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/RemoteDesktop/DefaultRemoteDesktopProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/RemoteDesktop/DefaultRemoteDesktopProvider.cs index bbef14c97..7ef7f7e8b 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/RemoteDesktop/DefaultRemoteDesktopProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/RemoteDesktop/DefaultRemoteDesktopProvider.cs @@ -226,6 +226,7 @@ namespace Tango.FSE.UI.RemoteDesktop } _frameDispatcher = new IntervalMessageDispatcher<StartRemoteDesktopSessionResponse>(OnRemoteDesktopResponse); + _frameDispatcher.DriftCompensationInterval = (int)TimeSpan.FromSeconds(10).TotalMilliseconds; _frameDispatcher.Start(); bool taskCompleted = false; diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj index 72b4bf121..0cdb832cb 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj @@ -614,7 +614,10 @@ </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <PropertyGroup> - <PostBuildEvent>RD /S /Q "$(TargetDir)cs\" + <PostBuildEvent>call "$(DevEnvDir)..\..\vc\vcvarsall.bat" x86 +"$(DevEnvDir)..\..\vc\bin\EditBin.exe" "$(TargetPath)" /LARGEADDRESSAWARE + +RD /S /Q "$(TargetDir)cs\" RD /S /Q "$(TargetDir)da\" RD /S /Q "$(TargetDir)de\" RD /S /Q "$(TargetDir)es\" diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml index 8b41332c2..771f35ccc 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml @@ -99,7 +99,7 @@ <material:PackIcon.Style> <Style TargetType="material:PackIcon"> <Setter Property="Foreground" Value="{StaticResource FSE_WarningBrush}"></Setter> - <Setter Property="ToolTip" Value="The system is currently offline. Please check your internet connection, some features might be disabled."></Setter> + <Setter Property="ToolTip" Value="The system is currently offline. Please check your internet connection, some features might not work."></Setter> <Style.Triggers> <DataTrigger Binding="{Binding ConnectivityProvider.IsOnline}" Value="True"> <Setter Property="Foreground" Value="{StaticResource FSE_SuccessBrush}"></Setter> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs index e7fcaf8d6..26859b94a 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs @@ -4,5 +4,5 @@ using System.Runtime.InteropServices; [assembly: System.Windows.ThemeInfo(System.Windows.ResourceDictionaryLocation.None, System.Windows.ResourceDictionaryLocation.SourceAssembly)] [assembly: AssemblyTitle("Tango - Machine Studio")] -[assembly: AssemblyVersion("4.1.8.0")] +[assembly: AssemblyVersion("4.1.9.0")] [assembly: ComVisible(false)]
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/FirmwareUpgradeViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/FirmwareUpgradeViewVM.cs index 365c1db49..7d2d8b401 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/FirmwareUpgradeViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/FirmwareUpgradeViewVM.cs @@ -202,6 +202,7 @@ namespace Tango.MachineStudio.UI.ViewModels { IsFree = true; CanClose = true; + _stream?.Dispose(); UpgradeError = ex.FlattenMessage(); CurrentPage = 3; } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/Tango.PPC.Publisher.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/Tango.PPC.Publisher.UI.csproj index f40a4b338..f524d9151 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/Tango.PPC.Publisher.UI.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/Tango.PPC.Publisher.UI.csproj @@ -133,6 +133,7 @@ <Generator>SettingsSingleFileGenerator</Generator> <LastGenOutput>Settings.Designer.cs</LastGenOutput> </None> + <None Include="Tango.PPC.Publisher.UI.json" /> </ItemGroup> <ItemGroup> <None Include="App.config" /> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/Tango.PPC.Publisher.UI.json b/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/Tango.PPC.Publisher.UI.json new file mode 100644 index 000000000..19dea4781 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/Tango.PPC.Publisher.UI.json @@ -0,0 +1,164 @@ +{ + "$type": "System.Collections.Generic.List`1[[Tango.Settings.SettingsBase, Tango.Settings]], mscorlib", + "$values": [ + { + "$type": "Tango.PPC.Common.PPCSettings, Tango.PPC.Common", + "ApplicationState": "PreSetup", + "MachineScanningTimeoutSeconds": 20, + "AutoConnectWiFiName": null, + "AutoConnectWiFiPassword": null, + "EmbeddedComPort": null, + "EmbeddedDeviceHint": "Tango USB Serial Port", + "EnableExternalBridge": false, + "ExternalBridgePassword": "Aa123456", + "EnableHotSpot": false, + "HotSpotPassword": "Aa123456", + "EnableRemoteAssistance": false, + "DeploymentSlot": "DEV", + "EnableWatchDog": true, + "EnableTechnicianModeByDefault": false, + "JobUploadStrategy": "JobDescriptionFile", + "EnableGradientGeneration": true, + "GradientGenerationResolution": 20, + "EnableLockScreen": false, + "LockScreenTimeout": "00:10:00", + "LockScreenPassword": "1111", + "EnableEmergencyNotifications": true, + "EmergencyComPort": "COM1", + "EnableJobLiquidQuantityValidation": true, + "JobUnitsMethod": "Device", + "LoadedRmlGuid": null, + "DefaultRmlGuid": null, + "SupportedColorSpaces": { + "$type": "System.Collections.Generic.List`1[[Tango.BL.Enumerations.ColorSpaces, Tango.BL]], mscorlib", + "$values": [] + }, + "SupportedJobTypes": { + "$type": "System.Collections.Generic.List`1[[Tango.BL.Enumerations.JobTypes, Tango.BL]], mscorlib", + "$values": [] + }, + "DefaultSpoolTypeGuid": null, + "DefaultSegmentLength": 100, + "PreviousApplicationVersion": "1.0.0.0", + "SynchronizeJobs": true, + "SynchronizeDiagnostics": true, + "SynchronizationInterval": "01:00:00", + "FirmwareVersion": "1.0.0.0", + "DisplayPowerUpScreen": true, + "PowerUpScreenTimeout": "00:00:20", + "AutoCheckForUpdates": true, + "AutoUpdateCheckInterval": "00:30:00", + "EnableAutomaticThreadLoading": true, + "DisplayAutomaticThreadLoadingScreen": true, + "EnableEmbeddedDebugLogs": true, + "TcpTransportAdapterWriteMode": "Interval", + "EnableExternalBridgeSignalR": true, + "ExternalBridgeSignalRHub": "ExternalBridgeHub", + "EnableRemoteDesktop": true, + "RemoteDesktopFrameRate": 5 + }, + { + "$type": "Tango.Core.CoreSettings, Tango.Core", + "DataSource": { + "$type": "Tango.Core.DataSource, Tango.Core", + "Type": "SQLServer", + "Address": "localhost\\SQLEXPRESS", + "Catalog": "Tango", + "IntegratedSecurity": true, + "UserName": "", + "Password": "", + "AccessToken": null, + "AccessTokenExpiration": "0001-01-01T00:00:00" + } + }, + { + "$type": "Tango.PPC.Publisher.UI.PublisherSettings, Tango.PPC.Publisher.UI", + "Options": { + "$type": "Tango.PPC.Common.Publish.PublishOptions, Tango.PPC.Common", + "BasePath": "D:\\Development\\Tango\\Software\\Visual_Studio\\Build\\PPC\\Debug\\..\\", + "BuildConfig": "Release", + "Email": "roy@twine-s.com", + "Password": "1Creativity", + "Comments": "Several bug fixes.", + "Environment": "TEST", + "MachineVersionGuid": "997a53b0-e752-474e-9618-7262c02d0127", + "TfpPath": "P:\\Software\\FirmwareUpgrade\\Version 1.4.6.20\\firmware_package.tfp", + "InstallerProject": "D:\\Development\\Tango\\Software\\Visual_Studio\\Advanced Installer Projects\\PPC Installer.aip", + "InstallerOutputFolder": "D:\\Development\\Tango\\Software\\Visual_Studio\\Build\\Installers\\PPC", + "Synchronization": { + "$type": "Tango.PPC.Common.Publish.SynchronizationOptions, Tango.PPC.Common", + "ProvisionSequenceItems": { + "$type": "System.Collections.ObjectModel.ObservableCollection`1[[Tango.PPC.Common.Publish.SequenceItem, Tango.PPC.Common]], System", + "$values": [ + { + "$type": "Tango.PPC.Common.Publish.SequenceItem, Tango.PPC.Common", + "Type": "Schema", + "Direction": "SourceToTarget", + "Index": 0, + "Name": "Synchronizing schema", + "FilePath": "D:\\Development\\Tango\\Software\\Visual_Studio\\Tango.SQLExaminer\\SQLExaminer\\Configurations\\Schema.xml", + "RequiresSerialNumber": false, + "FileName": "Schema.xml" + }, + { + "$type": "Tango.PPC.Common.Publish.SequenceItem, Tango.PPC.Common", + "Type": "Data", + "Direction": "SourceToTarget", + "Index": 1, + "Name": "Synchronizing collections", + "FilePath": "D:\\Development\\Tango\\Software\\Visual_Studio\\Tango.SQLExaminer\\SQLExaminer\\Configurations\\OverrideData.xml", + "RequiresSerialNumber": false, + "FileName": "OverrideData.xml" + }, + { + "$type": "Tango.PPC.Common.Publish.SequenceItem, Tango.PPC.Common", + "Type": "Data", + "Direction": "SourceToTarget", + "Index": 2, + "Name": "Configuring machine", + "FilePath": "D:\\Development\\Tango\\Software\\Visual_Studio\\Tango.SQLExaminer\\SQLExaminer\\Configurations\\ProvisionMachine.xml", + "RequiresSerialNumber": true, + "FileName": "ProvisionMachine.xml" + } + ] + }, + "UpdateSequenceItems": { + "$type": "System.Collections.ObjectModel.ObservableCollection`1[[Tango.PPC.Common.Publish.SequenceItem, Tango.PPC.Common]], System", + "$values": [ + { + "$type": "Tango.PPC.Common.Publish.SequenceItem, Tango.PPC.Common", + "Type": "Schema", + "Direction": "SourceToTarget", + "Index": 0, + "Name": "Updating schema", + "FilePath": "D:\\Development\\Tango\\Software\\Visual_Studio\\Tango.SQLExaminer\\SQLExaminer\\Configurations\\Schema.xml", + "RequiresSerialNumber": false, + "FileName": "Schema.xml" + }, + { + "$type": "Tango.PPC.Common.Publish.SequenceItem, Tango.PPC.Common", + "Type": "Data", + "Direction": "SourceToTarget", + "Index": 1, + "Name": "Updating collections", + "FilePath": "D:\\Development\\Tango\\Software\\Visual_Studio\\Tango.SQLExaminer\\SQLExaminer\\Configurations\\OverrideData.xml", + "RequiresSerialNumber": false, + "FileName": "OverrideData.xml" + }, + { + "$type": "Tango.PPC.Common.Publish.SequenceItem, Tango.PPC.Common", + "Type": "Data", + "Direction": "SourceToTarget", + "Index": 2, + "Name": "Updating machine", + "FilePath": "D:\\Development\\Tango\\Software\\Visual_Studio\\Tango.SQLExaminer\\SQLExaminer\\Configurations\\UpdateMachine.xml", + "RequiresSerialNumber": true, + "FileName": "UpdateMachine.xml" + } + ] + } + } + } + } + ] +}
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileView.xaml index fec166264..6f70b954d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileView.xaml @@ -23,7 +23,7 @@ <Run Text="{Binding PublishInfo.ApplicationVersion}"></Run> <LineBreak/> <Run FontWeight="SemiBold">Firmware:</Run> - <Run Text="{Binding FirmwareVersion}"></Run> + <Run Text="{Binding FirmwareVersion,Mode=OneWay}"></Run> </TextBlock> </StackPanel> </DockPanel> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs index 34465c81e..b51937fa2 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs @@ -8,4 +8,4 @@ using System.Windows; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Tango PPC Application")] -[assembly: AssemblyVersion("1.1.12.0")] +[assembly: AssemblyVersion("1.1.13.0")] diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest index efc5f8179..d72e75011 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest @@ -16,7 +16,7 @@ Remove this element if your application requires this virtualization for backwards compatibility. --> - <!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />--> + <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> </requestedPrivileges> </security> </trustInfo> diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.Basic/CompilationError.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.Basic/CompilationError.cs index 27c710b2f..eda72fa6e 100644 --- a/Software/Visual_Studio/Scripting/Tango.Scripting.Basic/CompilationError.cs +++ b/Software/Visual_Studio/Scripting/Tango.Scripting.Basic/CompilationError.cs @@ -12,6 +12,7 @@ namespace Tango.Scripting.Basic public String File { get; set; } public String Message { get; set; } public DiagnosticSeverity Severity { get; set; } + public int Position { get; set; } public int Line { get; set; } public int Column { get; set; } public int Length { get; set; } diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.Basic/Project.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.Basic/Project.cs index 446e5b529..fef43a35f 100644 --- a/Software/Visual_Studio/Scripting/Tango.Scripting.Basic/Project.cs +++ b/Software/Visual_Studio/Scripting/Tango.Scripting.Basic/Project.cs @@ -60,18 +60,6 @@ namespace Tango.Scripting.Basic Scripts.CollectionChanged += (x, e) => { RaisePropertyChanged(nameof(AdditionalScripts)); }; } - public static TProject New<TProject, TContext>(String name) where TProject : Project<TContext> where TContext : IContext - { - TProject p = Activator.CreateInstance<TProject>(); - - p.Name = name; - - p.ReferenceAssemblies.Add(ReferenceAssembly.FromType(typeof(String))); - p.ReferenceAssemblies.Add(ReferenceAssembly.FromType(typeof(Enumerable))); - p.ReferenceAssemblies.Add(ReferenceAssembly.FromType(typeof(Form))); - return p; - } - public Task<CompilationResult> Compile() { return Task.Factory.StartNew<CompilationResult>(() => @@ -85,6 +73,7 @@ namespace Tango.Scripting.Basic foreach (var script in Scripts) { script.LoadCount = 0; + script.LoadCharCount = 0; String code = script.Code; String codeFile = Path.Combine(tempFolder, script.Name); @@ -94,6 +83,7 @@ namespace Tango.Scripting.Basic { loadingString = $"#load \"{file}\"\n"; script.LoadCount++; + script.LoadCharCount += loadingString.Length; } code = loadingString + code; @@ -133,6 +123,8 @@ namespace Tango.Scripting.Basic var compileResults = s.Compile(); + GC.Collect(); + foreach (var error in compileResults.Where(x => x.Severity == Microsoft.CodeAnalysis.DiagnosticSeverity.Error)) { CompilationError cError = new CompilationError(); @@ -144,6 +136,7 @@ namespace Tango.Scripting.Basic Script errorScript = Scripts.Single(x => x.Name == cError.File); cError.Message = error.GetMessage(); cError.Severity = error.Severity; + cError.Position = error.Location.SourceSpan.Start - (errorScript != null ? errorScript.LoadCharCount : 0); var line = error.Location.GetMappedLineSpan(); cError.Line = line.StartLinePosition.Line + 1 - (errorScript != null ? errorScript.LoadCount : 0); cError.Column = line.StartLinePosition.Character + 1; @@ -187,6 +180,10 @@ namespace Tango.Scripting.Basic { session.Failed(ex.InnerException); } + finally + { + GC.Collect(); + } }); scriptThread.SetApartmentState(ApartmentState); diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.Basic/Script.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.Basic/Script.cs index 753026149..c465292cb 100644 --- a/Software/Visual_Studio/Scripting/Tango.Scripting.Basic/Script.cs +++ b/Software/Visual_Studio/Scripting/Tango.Scripting.Basic/Script.cs @@ -12,10 +12,39 @@ namespace Tango.Scripting.Basic { public class Script : ExtendedObject, IScriptSource { - public String Name { get; set; } - public String Code { get; set; } + private String _name; + public String Name + { + get { return _name; } + set { _name = value; RaisePropertyChangedAuto(); } + } + public bool IsEntryPoint { get; set; } + private String _code; + public String Code + { + get { return _code; } + set + { + if (_code != null && _code != value) + { + IsChanged = true; + } + + _code = value; + RaisePropertyChangedAuto(); + } + } + + private bool _isChanged; + [JsonIgnore] + public bool IsChanged + { + get { return _isChanged; } + set { _isChanged = value; RaisePropertyChangedAuto(); } + } + private bool _isSelected; [JsonIgnore] public bool IsSelected @@ -26,6 +55,8 @@ namespace Tango.Scripting.Basic [JsonIgnore] public int LoadCount { get; internal set; } + [JsonIgnore] + public int LoadCharCount { get; set; } public static Script New(String file) { diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/ScriptEditor.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/ScriptEditor.cs index d1ea9de43..2da7d3e46 100644 --- a/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/ScriptEditor.cs +++ b/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/ScriptEditor.cs @@ -36,6 +36,7 @@ using Tango.Scripting.Editors.Highlighting.Xshd; using Tango.Scripting.Editors.Intellisense; using Tango.Scripting.Editors.Popups; using Tango.Scripting.Editors.Rendering; +using Tango.Scripting.Formatting; using Tango.Scripting.Parsing; namespace Tango.Scripting.Editors @@ -1681,7 +1682,8 @@ namespace Tango.Scripting.Editors private void IndentCode() { - Text = Indentation.CSharp.CSharpIndentationHelper.IndentCSharpCode(Text); + Text = CodeFormatter.Format(Text); + //Text = Indentation.CSharp.CSharpIndentationHelper.IndentCSharpCode(Text); //Text = _parser.IndentCSharpCode(Text); } @@ -2100,5 +2102,35 @@ namespace Tango.Scripting.Editors } #endregion + + #region Public Methods + + public void FormatCode() + { + try + { + int index = CaretOffset; + Document.BeginUpdate(); + IndentCode(); + Document.EndUpdate(); + CaretOffset = index; + } + catch + { + Debug.WriteLine("Error formatting code."); + } + } + + public void Highlight(int position, int length) + { + Select(position, Math.Max(length, 1)); + } + + public void InsertCode(String code) + { + Document.Insert(TextArea.Caret.Offset, code); + } + + #endregion } } diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/Tango.Scripting.Editors.csproj b/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/Tango.Scripting.Editors.csproj index cabacbc28..5f9548262 100644 --- a/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/Tango.Scripting.Editors.csproj +++ b/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/Tango.Scripting.Editors.csproj @@ -590,6 +590,10 @@ <Project>{5812E1C6-ABAA-4066-94AC-971C27B4F46A}</Project> <Name>Tango.Scripting.Core</Name> </ProjectReference> + <ProjectReference Include="..\Tango.Scripting.Formatting\Tango.Scripting.Formatting.csproj"> + <Project>{8d8f06ed-7f75-4933-b0c5-829b0ff654d0}</Project> + <Name>Tango.Scripting.Formatting</Name> + </ProjectReference> <ProjectReference Include="..\Tango.Scripting\Tango.Scripting.csproj"> <Project>{1e938fd2-c669-4738-98c9-77f96ce4d451}</Project> <Name>Tango.Scripting</Name> @@ -642,7 +646,7 @@ </ItemGroup> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_UseGlobalSettings="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UseGlobalSettings="True" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.Formatting/CodeFormatter.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.Formatting/CodeFormatter.cs new file mode 100644 index 000000000..c933f7e09 --- /dev/null +++ b/Software/Visual_Studio/Scripting/Tango.Scripting.Formatting/CodeFormatter.cs @@ -0,0 +1,61 @@ +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.Formatting; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Scripting.Formatting +{ + public static class CodeFormatter + { + public static String Format(String code) + { + SyntaxTree tree = CSharpSyntaxTree.ParseText(code); + CompilationUnitSyntax root = tree.GetCompilationUnitRoot(); + + //var node = ApplyBraceNewLineRule(root); + //node = ApplyCopyrightHeaderRule(node); + //node = ApplyNewLineAboveRule(node); + //node = ApplyUsingLocationRule(node); + + //Just to make VS copy the dll to output folder. + Microsoft.CodeAnalysis.CSharp.Formatting.BinaryOperatorSpacingOptions a = Microsoft.CodeAnalysis.CSharp.Formatting.BinaryOperatorSpacingOptions.Ignore; + + var node = Formatter.Format(root, new AdhocWorkspace()); + + return node.ToString(); + } + + //private static SyntaxNode ApplyUsingLocationRule(SyntaxNode node) + //{ + // UsingLocationRule rule = new UsingLocationRule(); + // return rule.Process(node, "CSharp"); + //} + + //private static SyntaxNode ApplyBraceNewLineRule(SyntaxNode node) + //{ + // BraceNewLineRule rule = new BraceNewLineRule(); + // return rule.Process(node, "CSharp"); + //} + + //private static SyntaxNode ApplyNewLineAboveRule(SyntaxNode node) + //{ + // NewLineAboveRule rule = new NewLineAboveRule(); + // return rule.Process(node, "CSharp"); + //} + + //private static SyntaxNode ApplyCopyrightHeaderRule(SyntaxNode node) + //{ + // CopyrightHeaderRule rule = new CopyrightHeaderRule(new Microsoft.DotNet.CodeFormatting.Options() + // { + + // }); + + // return rule.ProcessCSharp(node); + //} + } +} diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.Formatting/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.Formatting/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..5436fc65e --- /dev/null +++ b/Software/Visual_Studio/Scripting/Tango.Scripting.Formatting/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Tango.Scripting.Formatting")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Tango.Scripting.Formatting")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("8d8f06ed-7f75-4933-b0c5-829b0ff654d0")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.Formatting/Tango.Scripting.Formatting.csproj b/Software/Visual_Studio/Scripting/Tango.Scripting.Formatting/Tango.Scripting.Formatting.csproj new file mode 100644 index 000000000..4e5b927b0 --- /dev/null +++ b/Software/Visual_Studio/Scripting/Tango.Scripting.Formatting/Tango.Scripting.Formatting.csproj @@ -0,0 +1,160 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="15.0" 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>{8D8F06ED-7F75-4933-B0C5-829B0FF654D0}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>Tango.Scripting.Formatting</RootNamespace> + <AssemblyName>Tango.Scripting.Formatting</AssemblyName> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <Deterministic>true</Deterministic> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\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> + <ItemGroup> + <Reference Include="Esent.Interop, Version=1.9.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\ManagedEsent.1.9.4\lib\net40\Esent.Interop.dll</HintPath> + </Reference> + <Reference Include="Microsoft.CodeAnalysis, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.CodeAnalysis.Common.2.4.0\lib\netstandard1.3\Microsoft.CodeAnalysis.dll</HintPath> + </Reference> + <Reference Include="Microsoft.CodeAnalysis.CSharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.CodeAnalysis.CSharp.2.4.0\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.dll</HintPath> + </Reference> + <Reference Include="Microsoft.CodeAnalysis.CSharp.Scripting, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.CodeAnalysis.CSharp.Scripting.2.4.0\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.Scripting.dll</HintPath> + </Reference> + <Reference Include="Microsoft.CodeAnalysis.CSharp.Workspaces, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.CodeAnalysis.CSharp.Workspaces.2.4.0\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.Workspaces.dll</HintPath> + </Reference> + <Reference Include="Microsoft.CodeAnalysis.Scripting, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.CodeAnalysis.Scripting.Common.2.4.0\lib\netstandard1.3\Microsoft.CodeAnalysis.Scripting.dll</HintPath> + </Reference> + <Reference Include="Microsoft.CodeAnalysis.Workspaces, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.2.4.0\lib\net46\Microsoft.CodeAnalysis.Workspaces.dll</HintPath> + </Reference> + <Reference Include="Microsoft.CodeAnalysis.Workspaces.Desktop, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.2.4.0\lib\net46\Microsoft.CodeAnalysis.Workspaces.Desktop.dll</HintPath> + </Reference> + <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.AppContext, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.AppContext.4.3.0\lib\net46\System.AppContext.dll</HintPath> + </Reference> + <Reference Include="System.Collections.Immutable, Version=1.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Collections.Immutable.1.3.1\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath> + </Reference> + <Reference Include="System.ComponentModel.Composition" /> + <Reference Include="System.Composition.AttributedModel, Version=1.0.31.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Composition.AttributedModel.1.0.31\lib\portable-net45+win8+wp8+wpa81\System.Composition.AttributedModel.dll</HintPath> + </Reference> + <Reference Include="System.Composition.Convention, Version=1.0.31.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Composition.Convention.1.0.31\lib\portable-net45+win8+wp8+wpa81\System.Composition.Convention.dll</HintPath> + </Reference> + <Reference Include="System.Composition.Hosting, Version=1.0.31.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Composition.Hosting.1.0.31\lib\portable-net45+win8+wp8+wpa81\System.Composition.Hosting.dll</HintPath> + </Reference> + <Reference Include="System.Composition.Runtime, Version=1.0.31.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Composition.Runtime.1.0.31\lib\portable-net45+win8+wp8+wpa81\System.Composition.Runtime.dll</HintPath> + </Reference> + <Reference Include="System.Composition.TypedParts, Version=1.0.31.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Composition.TypedParts.1.0.31\lib\portable-net45+win8+wp8+wpa81\System.Composition.TypedParts.dll</HintPath> + </Reference> + <Reference Include="System.Console, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Console.4.3.0\lib\net46\System.Console.dll</HintPath> + </Reference> + <Reference Include="System.Core" /> + <Reference Include="System.Diagnostics.FileVersionInfo, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Diagnostics.FileVersionInfo.4.3.0\lib\net46\System.Diagnostics.FileVersionInfo.dll</HintPath> + </Reference> + <Reference Include="System.Diagnostics.StackTrace, Version=4.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Diagnostics.StackTrace.4.3.0\lib\net46\System.Diagnostics.StackTrace.dll</HintPath> + </Reference> + <Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath> + </Reference> + <Reference Include="System.IO.FileSystem, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll</HintPath> + </Reference> + <Reference Include="System.IO.FileSystem.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll</HintPath> + </Reference> + <Reference Include="System.Numerics" /> + <Reference Include="System.Reflection.Metadata, Version=1.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Reflection.Metadata.1.4.2\lib\portable-net45+win8\System.Reflection.Metadata.dll</HintPath> + </Reference> + <Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath> + </Reference> + <Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath> + </Reference> + <Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath> + </Reference> + <Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath> + </Reference> + <Reference Include="System.Text.Encoding.CodePages, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Text.Encoding.CodePages.4.3.0\lib\net46\System.Text.Encoding.CodePages.dll</HintPath> + </Reference> + <Reference Include="System.Threading.Thread, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Threading.Thread.4.3.0\lib\net46\System.Threading.Thread.dll</HintPath> + </Reference> + <Reference Include="System.ValueTuple, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath> + </Reference> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Net.Http" /> + <Reference Include="System.Xml" /> + <Reference Include="System.Xml.ReaderWriter, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll</HintPath> + </Reference> + <Reference Include="System.Xml.XmlDocument, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Xml.XmlDocument.4.3.0\lib\net46\System.Xml.XmlDocument.dll</HintPath> + </Reference> + <Reference Include="System.Xml.XPath, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Xml.XPath.4.3.0\lib\net46\System.Xml.XPath.dll</HintPath> + </Reference> + <Reference Include="System.Xml.XPath.XDocument, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Xml.XPath.XDocument.4.3.0\lib\net46\System.Xml.XPath.XDocument.dll</HintPath> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="CodeFormatter.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="app.config" /> + <None Include="packages.config" /> + </ItemGroup> + <ItemGroup> + <Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll" /> + <Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> +</Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.Formatting/app.config b/Software/Visual_Studio/Scripting/Tango.Scripting.Formatting/app.config new file mode 100644 index 000000000..9da0b3b67 --- /dev/null +++ b/Software/Visual_Studio/Scripting/Tango.Scripting.Formatting/app.config @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.2.1.0" newVersion="1.2.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Threading.Thread" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + </dependentAssembly> + </assemblyBinding> + </runtime> +</configuration>
\ No newline at end of file diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.Formatting/packages.config b/Software/Visual_Studio/Scripting/Tango.Scripting.Formatting/packages.config new file mode 100644 index 000000000..6844de8c2 --- /dev/null +++ b/Software/Visual_Studio/Scripting/Tango.Scripting.Formatting/packages.config @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="ManagedEsent" version="1.9.4" targetFramework="net461" /> + <package id="Microsoft.CodeAnalysis.Analyzers" version="1.1.0" targetFramework="net461" /> + <package id="Microsoft.CodeAnalysis.Common" version="2.4.0" targetFramework="net461" /> + <package id="Microsoft.CodeAnalysis.CSharp" version="2.4.0" targetFramework="net461" /> + <package id="Microsoft.CodeAnalysis.CSharp.Scripting" version="2.4.0" targetFramework="net461" /> + <package id="Microsoft.CodeAnalysis.CSharp.Workspaces" version="2.4.0" targetFramework="net461" /> + <package id="Microsoft.CodeAnalysis.Scripting" version="2.4.0" targetFramework="net461" /> + <package id="Microsoft.CodeAnalysis.Scripting.Common" version="2.4.0" targetFramework="net461" /> + <package id="Microsoft.CodeAnalysis.Workspaces.Common" version="2.4.0" targetFramework="net461" /> + <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" /> + <package id="System.AppContext" version="4.3.0" targetFramework="net461" /> + <package id="System.Collections" version="4.3.0" targetFramework="net461" /> + <package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net461" /> + <package id="System.Collections.Immutable" version="1.3.1" targetFramework="net461" /> + <package id="System.Composition" version="1.0.31" targetFramework="net461" /> + <package id="System.Composition.AttributedModel" version="1.0.31" targetFramework="net461" /> + <package id="System.Composition.Convention" version="1.0.31" targetFramework="net461" /> + <package id="System.Composition.Hosting" version="1.0.31" targetFramework="net461" /> + <package id="System.Composition.Runtime" version="1.0.31" targetFramework="net461" /> + <package id="System.Composition.TypedParts" version="1.0.31" targetFramework="net461" /> + <package id="System.Console" version="4.3.0" targetFramework="net461" /> + <package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net461" /> + <package id="System.Diagnostics.FileVersionInfo" version="4.3.0" targetFramework="net461" /> + <package id="System.Diagnostics.StackTrace" version="4.3.0" targetFramework="net461" /> + <package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="net461" /> + <package id="System.Dynamic.Runtime" version="4.3.0" targetFramework="net461" /> + <package id="System.Globalization" version="4.3.0" targetFramework="net461" /> + <package id="System.IO" version="4.3.0" targetFramework="net461" /> + <package id="System.IO.Compression" version="4.3.0" targetFramework="net461" /> + <package id="System.IO.FileSystem" version="4.3.0" targetFramework="net461" /> + <package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net461" /> + <package id="System.Linq" version="4.3.0" targetFramework="net461" /> + <package id="System.Linq.Expressions" version="4.3.0" targetFramework="net461" /> + <package id="System.Reflection" version="4.3.0" targetFramework="net461" /> + <package id="System.Reflection.Extensions" version="4.3.0" targetFramework="net461" /> + <package id="System.Reflection.Metadata" version="1.4.2" targetFramework="net461" /> + <package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net461" /> + <package id="System.Runtime" version="4.3.0" targetFramework="net461" /> + <package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net461" /> + <package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net461" /> + <package id="System.Runtime.Numerics" version="4.3.0" targetFramework="net461" /> + <package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net461" /> + <package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net461" /> + <package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net461" /> + <package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net461" /> + <package id="System.Text.Encoding" version="4.3.0" targetFramework="net461" /> + <package id="System.Text.Encoding.CodePages" version="4.3.0" targetFramework="net461" /> + <package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="net461" /> + <package id="System.Threading" version="4.3.0" targetFramework="net461" /> + <package id="System.Threading.Tasks" version="4.3.0" targetFramework="net461" /> + <package id="System.Threading.Tasks.Parallel" version="4.3.0" targetFramework="net461" /> + <package id="System.Threading.Thread" version="4.3.0" targetFramework="net461" /> + <package id="System.ValueTuple" version="4.3.0" targetFramework="net461" /> + <package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="net461" /> + <package id="System.Xml.XDocument" version="4.3.0" targetFramework="net461" /> + <package id="System.Xml.XmlDocument" version="4.3.0" targetFramework="net461" /> + <package id="System.Xml.XPath" version="4.3.0" targetFramework="net461" /> + <package id="System.Xml.XPath.XDocument" version="4.3.0" targetFramework="net461" /> +</packages>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.BL/DTO/PublishedTestProjectDTO.cs b/Software/Visual_Studio/Tango.BL/DTO/PublishedTestProjectDTO.cs new file mode 100644 index 000000000..1aafdbebc --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/DTO/PublishedTestProjectDTO.cs @@ -0,0 +1,14 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.BL.DTO +{ + public class PublishedTestProjectDTO : PublishedTestProjectDTOBase + { + + } +} diff --git a/Software/Visual_Studio/Tango.BL/DTO/PublishedTestProjectDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/PublishedTestProjectDTOBase.cs new file mode 100644 index 000000000..53ef2576a --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/DTO/PublishedTestProjectDTOBase.cs @@ -0,0 +1,57 @@ + +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Tango Observables Generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. Do not modify! +// </auto-generated> +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; + +namespace Tango.BL.DTO +{ + public abstract class PublishedTestProjectDTOBase : ObservableEntityDTO<PublishedTestProjectDTO, PublishedTestProject> + { + + /// <summary> + /// name + /// </summary> + public String Name + { + get; set; + } + + /// <summary> + /// description + /// </summary> + public String Description + { + get; set; + } + + /// <summary> + /// publish date + /// </summary> + public DateTime PublishDate + { + get; set; + } + + /// <summary> + /// is visible + /// </summary> + public Boolean IsVisible + { + get; set; + } + + } +} diff --git a/Software/Visual_Studio/Tango.BL/DTO/PublishedTestProjectsVersionDTO.cs b/Software/Visual_Studio/Tango.BL/DTO/PublishedTestProjectsVersionDTO.cs new file mode 100644 index 000000000..a61ae7ea9 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/DTO/PublishedTestProjectsVersionDTO.cs @@ -0,0 +1,14 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.BL.DTO +{ + public class PublishedTestProjectsVersionDTO : PublishedTestProjectsVersionDTOBase + { + + } +} diff --git a/Software/Visual_Studio/Tango.BL/DTO/PublishedTestProjectsVersionDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/PublishedTestProjectsVersionDTOBase.cs new file mode 100644 index 000000000..88dbc572b --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/DTO/PublishedTestProjectsVersionDTOBase.cs @@ -0,0 +1,57 @@ + +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Tango Observables Generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. Do not modify! +// </auto-generated> +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; + +namespace Tango.BL.DTO +{ + public abstract class PublishedTestProjectsVersionDTOBase : ObservableEntityDTO<PublishedTestProjectsVersionDTO, PublishedTestProjectsVersion> + { + + /// <summary> + /// published test project guid + /// </summary> + public String PublishedTestProjectGuid + { + get; set; + } + + /// <summary> + /// version + /// </summary> + public Int32 Version + { + get; set; + } + + /// <summary> + /// author + /// </summary> + public String Author + { + get; set; + } + + /// <summary> + /// project json string + /// </summary> + public String ProjectJsonString + { + get; set; + } + + } +} diff --git a/Software/Visual_Studio/Tango.BL/Entities/PublishedTestProject.cs b/Software/Visual_Studio/Tango.BL/Entities/PublishedTestProject.cs new file mode 100644 index 000000000..46cf1c742 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/Entities/PublishedTestProject.cs @@ -0,0 +1,23 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.BL.Entities +{ + public class PublishedTestProject : PublishedTestProjectBase + { + [NotMapped] + [JsonIgnore] + public PublishedTestProjectsVersion CurrentVersion + { + get + { + return PublishedTestProjectsVersions.OrderBy(x => x.Version).LastOrDefault(); + } + } + } +} diff --git a/Software/Visual_Studio/Tango.BL/Entities/PublishedTestProjectBase.cs b/Software/Visual_Studio/Tango.BL/Entities/PublishedTestProjectBase.cs new file mode 100644 index 000000000..cadd50202 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/Entities/PublishedTestProjectBase.cs @@ -0,0 +1,228 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Tango Observables Generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. Do not modify! +// </auto-generated> +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; +using System.Linq; +using Tango.DAL.Remote.DB; +using Tango.Core; +using System.ComponentModel; +using Tango.Core.CustomAttributes; + +namespace Tango.BL.Entities +{ + [Table("PUBLISHED_TEST_PROJECTS")] + public abstract class PublishedTestProjectBase : ObservableEntity<PublishedTestProject> + { + + public event EventHandler<String> NameChanged; + + public event EventHandler<String> DescriptionChanged; + + public event EventHandler<DateTime> PublishDateChanged; + + public event EventHandler<Boolean> IsVisibleChanged; + + public event EventHandler<SynchronizedObservableCollection<PublishedTestProjectsVersion>> PublishedTestProjectsVersionsChanged; + + protected String _name; + + /// <summary> + /// Gets or sets the publishedtestprojectbase name. + /// </summary> + + [Column("NAME")] + + public String Name + { + get + { + return _name; + } + + set + { + if (_name != value) + { + _name = value; + + OnNameChanged(value); + + } + } + } + + protected String _description; + + /// <summary> + /// Gets or sets the publishedtestprojectbase description. + /// </summary> + + [Column("DESCRIPTION")] + + public String Description + { + get + { + return _description; + } + + set + { + if (_description != value) + { + _description = value; + + OnDescriptionChanged(value); + + } + } + } + + protected DateTime _publishdate; + + /// <summary> + /// Gets or sets the publishedtestprojectbase publish date. + /// </summary> + + [Column("PUBLISH_DATE")] + + public DateTime PublishDate + { + get + { + return _publishdate; + } + + set + { + if (_publishdate != value) + { + _publishdate = value; + + OnPublishDateChanged(value); + + } + } + } + + protected Boolean _isvisible; + + /// <summary> + /// Gets or sets the publishedtestprojectbase is visible. + /// </summary> + + [Column("IS_VISIBLE")] + + public Boolean IsVisible + { + get + { + return _isvisible; + } + + set + { + if (_isvisible != value) + { + _isvisible = value; + + OnIsVisibleChanged(value); + + } + } + } + + protected SynchronizedObservableCollection<PublishedTestProjectsVersion> _publishedtestprojectsversions; + + /// <summary> + /// Gets or sets the publishedtestprojectbase published test projects versions. + /// </summary> + + public virtual SynchronizedObservableCollection<PublishedTestProjectsVersion> PublishedTestProjectsVersions + { + get + { + return _publishedtestprojectsversions; + } + + set + { + if (_publishedtestprojectsversions != value) + { + _publishedtestprojectsversions = value; + + OnPublishedTestProjectsVersionsChanged(value); + + } + } + } + + /// <summary> + /// Called when the Name has changed. + /// </summary> + protected virtual void OnNameChanged(String name) + { + NameChanged?.Invoke(this, name); + RaisePropertyChanged(nameof(Name)); + } + + /// <summary> + /// Called when the Description has changed. + /// </summary> + protected virtual void OnDescriptionChanged(String description) + { + DescriptionChanged?.Invoke(this, description); + RaisePropertyChanged(nameof(Description)); + } + + /// <summary> + /// Called when the PublishDate has changed. + /// </summary> + protected virtual void OnPublishDateChanged(DateTime publishdate) + { + PublishDateChanged?.Invoke(this, publishdate); + RaisePropertyChanged(nameof(PublishDate)); + } + + /// <summary> + /// Called when the IsVisible has changed. + /// </summary> + protected virtual void OnIsVisibleChanged(Boolean isvisible) + { + IsVisibleChanged?.Invoke(this, isvisible); + RaisePropertyChanged(nameof(IsVisible)); + } + + /// <summary> + /// Called when the PublishedTestProjectsVersions has changed. + /// </summary> + protected virtual void OnPublishedTestProjectsVersionsChanged(SynchronizedObservableCollection<PublishedTestProjectsVersion> publishedtestprojectsversions) + { + PublishedTestProjectsVersionsChanged?.Invoke(this, publishedtestprojectsversions); + RaisePropertyChanged(nameof(PublishedTestProjectsVersions)); + } + + /// <summary> + /// Initializes a new instance of the <see cref="PublishedTestProjectBase" /> class. + /// </summary> + public PublishedTestProjectBase() : base() + { + + PublishedTestProjectsVersions = new SynchronizedObservableCollection<PublishedTestProjectsVersion>(); + + } + } +} diff --git a/Software/Visual_Studio/Tango.BL/Entities/PublishedTestProjectsVersion.cs b/Software/Visual_Studio/Tango.BL/Entities/PublishedTestProjectsVersion.cs new file mode 100644 index 000000000..a3a5ed06b --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/Entities/PublishedTestProjectsVersion.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.BL.Entities +{ + public class PublishedTestProjectsVersion : PublishedTestProjectsVersionBase + { + + } +} diff --git a/Software/Visual_Studio/Tango.BL/Entities/PublishedTestProjectsVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/PublishedTestProjectsVersionBase.cs new file mode 100644 index 000000000..b250c0636 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/Entities/PublishedTestProjectsVersionBase.cs @@ -0,0 +1,220 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Tango Observables Generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. Do not modify! +// </auto-generated> +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; +using System.Linq; +using Tango.DAL.Remote.DB; +using Tango.Core; +using System.ComponentModel; +using Tango.Core.CustomAttributes; + +namespace Tango.BL.Entities +{ + [Table("PUBLISHED_TEST_PROJECTS_VERSIONS")] + public abstract class PublishedTestProjectsVersionBase : ObservableEntity<PublishedTestProjectsVersion> + { + + public event EventHandler<Int32> VersionChanged; + + public event EventHandler<String> AuthorChanged; + + public event EventHandler<String> ProjectJsonStringChanged; + + public event EventHandler<PublishedTestProject> PublishedTestProjectChanged; + + protected String _publishedtestprojectguid; + + /// <summary> + /// Gets or sets the publishedtestprojectsversionbase published test project guid. + /// </summary> + + [Column("PUBLISHED_TEST_PROJECT_GUID")] + [ForeignKey("PublishedTestProject")] + + public String PublishedTestProjectGuid + { + get + { + return _publishedtestprojectguid; + } + + set + { + if (_publishedtestprojectguid != value) + { + _publishedtestprojectguid = value; + + } + } + } + + protected Int32 _version; + + /// <summary> + /// Gets or sets the publishedtestprojectsversionbase version. + /// </summary> + + [Column("VERSION")] + + public Int32 Version + { + get + { + return _version; + } + + set + { + if (_version != value) + { + _version = value; + + OnVersionChanged(value); + + } + } + } + + protected String _author; + + /// <summary> + /// Gets or sets the publishedtestprojectsversionbase author. + /// </summary> + + [Column("AUTHOR")] + + public String Author + { + get + { + return _author; + } + + set + { + if (_author != value) + { + _author = value; + + OnAuthorChanged(value); + + } + } + } + + protected String _projectjsonstring; + + /// <summary> + /// Gets or sets the publishedtestprojectsversionbase project json string. + /// </summary> + + [Column("PROJECT_JSON_STRING")] + + public String ProjectJsonString + { + get + { + return _projectjsonstring; + } + + set + { + if (_projectjsonstring != value) + { + _projectjsonstring = value; + + OnProjectJsonStringChanged(value); + + } + } + } + + protected PublishedTestProject _publishedtestproject; + + /// <summary> + /// Gets or sets the publishedtestprojectsversionbase published test projects. + /// </summary> + + [XmlIgnore] + [JsonIgnore] + public virtual PublishedTestProject PublishedTestProject + { + get + { + return _publishedtestproject; + } + + set + { + if (_publishedtestproject != value) + { + _publishedtestproject = value; + + if (PublishedTestProject != null) + { + PublishedTestProjectGuid = PublishedTestProject.Guid; + } + + OnPublishedTestProjectChanged(value); + + } + } + } + + /// <summary> + /// Called when the Version has changed. + /// </summary> + protected virtual void OnVersionChanged(Int32 version) + { + VersionChanged?.Invoke(this, version); + RaisePropertyChanged(nameof(Version)); + } + + /// <summary> + /// Called when the Author has changed. + /// </summary> + protected virtual void OnAuthorChanged(String author) + { + AuthorChanged?.Invoke(this, author); + RaisePropertyChanged(nameof(Author)); + } + + /// <summary> + /// Called when the ProjectJsonString has changed. + /// </summary> + protected virtual void OnProjectJsonStringChanged(String projectjsonstring) + { + ProjectJsonStringChanged?.Invoke(this, projectjsonstring); + RaisePropertyChanged(nameof(ProjectJsonString)); + } + + /// <summary> + /// Called when the PublishedTestProject has changed. + /// </summary> + protected virtual void OnPublishedTestProjectChanged(PublishedTestProject publishedtestproject) + { + PublishedTestProjectChanged?.Invoke(this, publishedtestproject); + RaisePropertyChanged(nameof(PublishedTestProject)); + } + + /// <summary> + /// Initializes a new instance of the <see cref="PublishedTestProjectsVersionBase" /> class. + /// </summary> + public PublishedTestProjectsVersionBase() : base() + { + } + } +} diff --git a/Software/Visual_Studio/Tango.BL/ObservablesContext.cs b/Software/Visual_Studio/Tango.BL/ObservablesContext.cs index b2881c741..f1f624576 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesContext.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesContext.cs @@ -487,6 +487,22 @@ namespace Tango.BL } /// <summary> + /// Gets or sets the PublishedTestProjects. + /// </summary> + public DbSet<PublishedTestProject> PublishedTestProjects + { + get; set; + } + + /// <summary> + /// Gets or sets the PublishedTestProjectsVersions. + /// </summary> + public DbSet<PublishedTestProjectsVersion> PublishedTestProjectsVersions + { + get; set; + } + + /// <summary> /// Gets or sets the Rmls. /// </summary> public DbSet<Rml> Rmls diff --git a/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs b/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs index 59b5253bc..94ceec29e 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs @@ -2105,6 +2105,78 @@ namespace Tango.BL } + private ObservableCollection<PublishedTestProject> _publishedtestprojects; + /// <summary> + /// Gets or sets the PublishedTestProjects. + /// </summary> + public ObservableCollection<PublishedTestProject> PublishedTestProjects + { + get + { + return _publishedtestprojects; + } + + set + { + _publishedtestprojects = value; RaisePropertyChanged(nameof(PublishedTestProjects)); + } + + } + + private ICollectionView _publishedtestprojectsViewSource; + /// <summary> + /// Gets or sets the PublishedTestProjects View Source. + ///</summary> + public ICollectionView PublishedTestProjectsViewSource + { + get + { + return _publishedtestprojectsViewSource; + } + + set + { + _publishedtestprojectsViewSource = value; RaisePropertyChanged(nameof(PublishedTestProjectsViewSource)); + } + + } + + private ObservableCollection<PublishedTestProjectsVersion> _publishedtestprojectsversions; + /// <summary> + /// Gets or sets the PublishedTestProjectsVersions. + /// </summary> + public ObservableCollection<PublishedTestProjectsVersion> PublishedTestProjectsVersions + { + get + { + return _publishedtestprojectsversions; + } + + set + { + _publishedtestprojectsversions = value; RaisePropertyChanged(nameof(PublishedTestProjectsVersions)); + } + + } + + private ICollectionView _publishedtestprojectsversionsViewSource; + /// <summary> + /// Gets or sets the PublishedTestProjectsVersions View Source. + ///</summary> + public ICollectionView PublishedTestProjectsVersionsViewSource + { + get + { + return _publishedtestprojectsversionsViewSource; + } + + set + { + _publishedtestprojectsversionsViewSource = value; RaisePropertyChanged(nameof(PublishedTestProjectsVersionsViewSource)); + } + + } + private ObservableCollection<Rml> _rmls; /// <summary> /// Gets or sets the Rmls. @@ -3019,6 +3091,10 @@ namespace Tango.BL ProcessParametersTablesGroupsViewSource = CreateCollectionView(ProcessParametersTablesGroups); + PublishedTestProjectsViewSource = CreateCollectionView(PublishedTestProjects); + + PublishedTestProjectsVersionsViewSource = CreateCollectionView(PublishedTestProjectsVersions); + RmlsViewSource = CreateCollectionView(Rmls); RmlsSpoolsViewSource = CreateCollectionView(RmlsSpools); diff --git a/Software/Visual_Studio/Tango.BL/ObservablesStaticCollectionsExtension.cs b/Software/Visual_Studio/Tango.BL/ObservablesStaticCollectionsExtension.cs index 178a62595..45ecb8212 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesStaticCollectionsExtension.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesStaticCollectionsExtension.cs @@ -2105,6 +2105,78 @@ namespace Tango.BL } + private ObservableCollection<PublishedTestProject> _publishedtestprojects; + /// <summary> + /// Gets or sets the PublishedTestProjects. + /// </summary> + public ObservableCollection<PublishedTestProject> PublishedTestProjects + { + get + { + return _publishedtestprojects; + } + + set + { + _publishedtestprojects = value; RaisePropertyChanged(nameof(PublishedTestProjects)); + } + + } + + private ICollectionView _publishedtestprojectsViewSource; + /// <summary> + /// Gets or sets the PublishedTestProjects View Source. + ///</summary> + public ICollectionView PublishedTestProjectsViewSource + { + get + { + return _publishedtestprojectsViewSource; + } + + set + { + _publishedtestprojectsViewSource = value; RaisePropertyChanged(nameof(PublishedTestProjectsViewSource)); + } + + } + + private ObservableCollection<PublishedTestProjectsVersion> _publishedtestprojectsversions; + /// <summary> + /// Gets or sets the PublishedTestProjectsVersions. + /// </summary> + public ObservableCollection<PublishedTestProjectsVersion> PublishedTestProjectsVersions + { + get + { + return _publishedtestprojectsversions; + } + + set + { + _publishedtestprojectsversions = value; RaisePropertyChanged(nameof(PublishedTestProjectsVersions)); + } + + } + + private ICollectionView _publishedtestprojectsversionsViewSource; + /// <summary> + /// Gets or sets the PublishedTestProjectsVersions View Source. + ///</summary> + public ICollectionView PublishedTestProjectsVersionsViewSource + { + get + { + return _publishedtestprojectsversionsViewSource; + } + + set + { + _publishedtestprojectsversionsViewSource = value; RaisePropertyChanged(nameof(PublishedTestProjectsVersionsViewSource)); + } + + } + private ObservableCollection<Rml> _rmls; /// <summary> /// Gets or sets the Rmls. @@ -3019,6 +3091,10 @@ namespace Tango.BL ProcessParametersTablesGroupsViewSource = CreateCollectionView(ProcessParametersTablesGroups); + PublishedTestProjectsViewSource = CreateCollectionView(PublishedTestProjects); + + PublishedTestProjectsVersionsViewSource = CreateCollectionView(PublishedTestProjectsVersions); + RmlsViewSource = CreateCollectionView(Rmls); RmlsSpoolsViewSource = CreateCollectionView(RmlsSpools); diff --git a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj index 065513114..eea731458 100644 --- a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj +++ b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj @@ -252,6 +252,10 @@ <Compile Include="DTO\ProcessParametersTableDTOBase.cs" /> <Compile Include="DTO\ProcessParametersTablesGroupDTO.cs" /> <Compile Include="DTO\ProcessParametersTablesGroupDTOBase.cs" /> + <Compile Include="DTO\PublishedTestProjectDTO.cs" /> + <Compile Include="DTO\PublishedTestProjectDTOBase.cs" /> + <Compile Include="DTO\PublishedTestProjectsVersionDTO.cs" /> + <Compile Include="DTO\PublishedTestProjectsVersionDTOBase.cs" /> <Compile Include="DTO\RmlDTO.cs" /> <Compile Include="DTO\RmlDTOBase.cs" /> <Compile Include="DTO\RmlsSpoolDTO.cs" /> @@ -365,6 +369,10 @@ <Compile Include="Entities\PermissionBase.cs" /> <Compile Include="Entities\ProcessParametersTableBase.cs" /> <Compile Include="Entities\ProcessParametersTablesGroupBase.cs" /> + <Compile Include="Entities\PublishedTestProject.cs" /> + <Compile Include="Entities\PublishedTestProjectBase.cs" /> + <Compile Include="Entities\PublishedTestProjectsVersionBase.cs" /> + <Compile Include="Entities\PublishedTestProjectsVersion.cs" /> <Compile Include="Entities\RmlBase.cs" /> <Compile Include="Entities\RmlsSpoolBase.cs" /> <Compile Include="Entities\RmlsSpool.cs" /> @@ -620,7 +628,7 @@ </Target> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.ColorPickers/ColorPickerControl.cs b/Software/Visual_Studio/Tango.ColorPickers/ColorPickerControl.cs new file mode 100644 index 000000000..c07f4b49c --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPickers/ColorPickerControl.cs @@ -0,0 +1,110 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; + +namespace Tango.ColorPickers +{ + [TemplatePart(Name = PART_ColorPickerSlider, Type = typeof(ColorPickerSlider))] + [TemplatePart(Name = PART_ColorPickerNumericUpDown, Type = typeof(ColorPickerNumericUpDown))] + public class ColorPickerControl: Control + { + private const string PART_ColorPickerSlider = "PART_ColorPickerSlider"; + private const string PART_ColorPickerNumericUpDown = "PART_ColorPickerNumericUpDown"; + + #region Members + private ColorPickerSlider _colorPickerSlider; + private ColorPickerNumericUpDown _colorPickerNumericUpDown; + #endregion + + #region Properties + + public int MinValue + { + get { return (int)GetValue(MinValueProperty); } + set { SetValue(MinValueProperty, value); } + } + + /// <summary> + /// The slider minimum value property + /// </summary> + public static readonly DependencyProperty MinValueProperty = + DependencyProperty.Register("MinValue", typeof(int), typeof(ColorPickerControl), new PropertyMetadata(0)); + + + public int MaxValue + { + get { return (int)GetValue(MaxValueProperty); } + set { SetValue(MaxValueProperty, value); } + } + + /// <summary> + /// The slider maximum value property + /// </summary> + public static readonly DependencyProperty MaxValueProperty = + DependencyProperty.Register("MaxValue", typeof(int), typeof(ColorPickerControl), new PropertyMetadata(0)); + + + + #endregion + + static ColorPickerControl() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(ColorPickerControl), new FrameworkPropertyMetadata(typeof(ColorPickerControl))); + } + + #region Base Class Overrides + + public override void OnApplyTemplate() + { + base.OnApplyTemplate(); + if (_colorPickerSlider != null) + _colorPickerSlider.ValueChanged -= ColorPickerSlider_ValueChanged; + + _colorPickerSlider = GetTemplateChild(PART_ColorPickerSlider) as ColorPickerSlider; + + if (_colorPickerSlider != null) + { + _colorPickerSlider.ValueChanged += ColorPickerSlider_ValueChanged; + _colorPickerSlider.Minimum = MinValue; + _colorPickerSlider.Maximum = MaxValue; + } + + + if (_colorPickerNumericUpDown != null) + { + _colorPickerNumericUpDown.ColorNumberChanged -= ColorPickerNumber_ValueChanged; + } + + _colorPickerNumericUpDown = GetTemplateChild(PART_ColorPickerNumericUpDown) as ColorPickerNumericUpDown; + + if (_colorPickerNumericUpDown != null) + { + _colorPickerNumericUpDown.ColorNumberChanged += ColorPickerNumber_ValueChanged; + } + } + + private void ColorPickerNumber_ValueChanged(object sender, RoutedPropertyChangedEventArgs<int?> e) + { + if (_colorPickerSlider != null) + { + _colorPickerSlider.Value = (double)e.NewValue; + } + } + + #endregion + #region Events Handlers + void ColorPickerSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) + { + if (_colorPickerNumericUpDown != null) + { + _colorPickerNumericUpDown.Value = (int)e.NewValue; + } + } + #endregion + + } +} diff --git a/Software/Visual_Studio/Tango.ColorPickers/ColorPickerNumericUpDown.cs b/Software/Visual_Studio/Tango.ColorPickers/ColorPickerNumericUpDown.cs new file mode 100644 index 000000000..83a8e2336 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPickers/ColorPickerNumericUpDown.cs @@ -0,0 +1,191 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; +using Tango.Core.Commands; + +namespace Tango.ColorPickers +{ + [TemplatePart(Name = ColorPickerNumericUpDown.Number_PART, Type = typeof(TextBox))] + public class ColorPickerNumericUpDown : Control + { + public const string Number_PART = "Number_PART"; + private TextBox _numericValue; + + #region Properties + + public int Value + { + get { return (int)GetValue(ValueProperty); } + set { SetValue(ValueProperty, value); IncrementCommand.RaiseCanExecuteChanged(); DecrementCommand.RaiseCanExecuteChanged(); } + } + /// <summary> + /// The value property of slider + /// </summary> + public static readonly DependencyProperty ValueProperty = + DependencyProperty.Register("Value", typeof(int), typeof(ColorPickerNumericUpDown), new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback(OnValueChanged))); + + public int MinValue + { + get { return (int)GetValue(MinValueProperty); } + set { SetValue(MinValueProperty, value); } + } + + /// <summary> + /// The slider minimum value property + /// </summary> + public static readonly DependencyProperty MinValueProperty = + DependencyProperty.Register("MinValue", typeof(int), typeof(ColorPickerNumericUpDown), new PropertyMetadata(0)); + + + public int MaxValue + { + get { return (int)GetValue(MaxValueProperty); } + set { SetValue(MaxValueProperty, value); } + } + + /// <summary> + /// The slider maximum value property + /// </summary> + public static readonly DependencyProperty MaxValueProperty = + DependencyProperty.Register("MaxValue", typeof(int), typeof(ColorPickerNumericUpDown), new PropertyMetadata(0)); + + + #endregion + #region Constructors + + static ColorPickerNumericUpDown() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(ColorPickerNumericUpDown), new FrameworkPropertyMetadata(typeof(ColorPickerNumericUpDown))); + } + + public ColorPickerNumericUpDown() : base() + { + IncrementCommand = new RelayCommand(OnIncrementValue, OnCanIncrementValue); + DecrementCommand = new RelayCommand(OnDecrementValue, OnCanDecrementValue); + MinValue = 0; + MaxValue = 100; + } + + private bool OnCanDecrementValue(object arg) + { + return (Value - 1) >= MinValue; + } + + private bool OnCanIncrementValue(object arg) + { + return (Value + 1) <= MaxValue; + } + #endregion + + #region Base Class Overrides + + public override void OnApplyTemplate() + { + base.OnApplyTemplate(); + if (_numericValue != null) + { + _numericValue.TextChanged -= OnNumberChanged; + _numericValue.PreviewTextInput -= OnPreviewTextInput; + } + _numericValue = (TextBox)GetTemplateChild(Number_PART); + if(_numericValue != null) + { + _numericValue.TextChanged += OnNumberChanged; + _numericValue.PreviewTextInput += OnPreviewTextInput; + } + } + #endregion + + #region Methods + private void OnPreviewTextInput(object sender, TextCompositionEventArgs e) + { + Regex regex = new Regex("[^0-9]+"); + if(regex.IsMatch(e.Text)) + { + + } + e.Handled = regex.IsMatch(e.Text); + } + private void OnNumberChanged(object sender, TextChangedEventArgs e) + { + string text = _numericValue.Text; + int value; + if (Int32.TryParse(text, out value)) + { + Value = value; + } + } + + private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + ColorPickerNumericUpDown colorPickerNumericUpDown = (ColorPickerNumericUpDown)d; + if (colorPickerNumericUpDown != null) + colorPickerNumericUpDown.OnValueNumberChanged((int?)e.OldValue, (int?)e.NewValue); + + } + + private void OnValueNumberChanged(int? oldValue, int? newValue) + { + RoutedPropertyChangedEventArgs<int?> args = new RoutedPropertyChangedEventArgs<int?>(oldValue, newValue); + args.RoutedEvent = ColorPickerNumericUpDown.ColorNumberChangedEvent; + RaiseEvent(args); + } + + #endregion + #region Commands + /// <summary> + /// The increment value command property + /// </summary> + /// + public static DependencyProperty IncrementCommandProperty = DependencyProperty.Register("IncrementCommand", typeof(RelayCommand), typeof(ColorPickerNumericUpDown)); + public RelayCommand IncrementCommand + { + get { return (RelayCommand)GetValue(IncrementCommandProperty); } + private set { SetValue(IncrementCommandProperty, value); } + } + + /// <summary> + /// The decrement command property + /// </summary> + public static DependencyProperty DecrementCommandProperty = DependencyProperty.Register("DecrementCommand", typeof(RelayCommand), typeof(ColorPickerNumericUpDown)); + public RelayCommand DecrementCommand + { + get { return (RelayCommand)GetValue(DecrementCommandProperty); } + private set { SetValue(DecrementCommandProperty, value); } + } + + private void OnDecrementValue(object obj) + { + Value -= 1; + } + + private void OnIncrementValue() + { + Value += 1; + } + #endregion + #region Events + + public static readonly RoutedEvent ColorNumberChangedEvent = EventManager.RegisterRoutedEvent("ColorNumberChanged", RoutingStrategy.Bubble, typeof(RoutedPropertyChangedEventHandler<int?>), typeof(ColorPickerNumericUpDown)); + public event RoutedPropertyChangedEventHandler<int?> ColorNumberChanged + { + add + { + AddHandler(ColorNumberChangedEvent, value); + } + remove + { + RemoveHandler(ColorNumberChangedEvent, value); + } + } + + #endregion + + } +} diff --git a/Software/Visual_Studio/Tango.ColorPickers/ColorPickerSlider.cs b/Software/Visual_Studio/Tango.ColorPickers/ColorPickerSlider.cs new file mode 100644 index 000000000..5a7f9aeac --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPickers/ColorPickerSlider.cs @@ -0,0 +1,270 @@ +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.Controls.Primitives; +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 Xceed.Wpf.Toolkit.Core.Utilities; + +namespace Tango.ColorPickers +{ + /// <summary> + /// Follow steps 1a or 1b and then 2 to use this custom control in a XAML file. + /// + /// Step 1a) Using this custom control in a XAML file that exists in the current project. + /// Add this XmlNamespace attribute to the root element of the markup file where it is + /// to be used: + /// + /// xmlns:MyNamespace="clr-namespace:Tango.ColorPickers" + /// + /// + /// Step 1b) Using this custom control in a XAML file that exists in a different project. + /// Add this XmlNamespace attribute to the root element of the markup file where it is + /// to be used: + /// + /// xmlns:MyNamespace="clr-namespace:Tango.ColorPickers;assembly=Tango.ColorPickers" + /// + /// You will also need to add a project reference from the project where the XAML file lives + /// to this project and Rebuild to avoid compilation errors: + /// + /// Right click on the target project in the Solution Explorer and + /// "Add Reference"->"Projects"->[Select this project] + /// + /// + /// Step 2) + /// Go ahead and use your control in the XAML file. + /// + /// <MyNamespace:CustomControl1/> + /// + /// </summary> + [TemplatePart(Name = PART_ColorPickerDisplay, Type = typeof(Border))] + [TemplatePart(Name = PART_Thumb, Type = typeof(Track))] + [TemplatePart(Name = PART_InsideThumb, Type = typeof(Ellipse))] + public class ColorPickerSlider : Slider + { + private const string PART_ColorPickerDisplay = "PART_ColorPickerDisplay"; + private const string PART_Thumb = "PART_Track"; + private const string PART_InsideThumb = "PART_InsideThumb"; + #region Members + private Border _colorPickerDisplay; + private LinearGradientBrush _pickerBrush; + private Ellipse _insideThumb; + #endregion + + static ColorPickerSlider() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(ColorPickerSlider), new FrameworkPropertyMetadata(typeof(ColorPickerSlider))); + } + + public static readonly DependencyProperty SelectedColorProperty = DependencyProperty.Register("SelectedColor", typeof(Color?), typeof(ColorPickerSlider), 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) + { + ColorPickerSlider colorPicker = (ColorPickerSlider)d; + if (colorPicker != null) + colorPicker.OnSelectedColorChanged((Color?)e.OldValue, (Color?)e.NewValue); + } + + private void OnSelectedColorChanged(Color? oldValue, Color? newValue) + { + RoutedPropertyChangedEventArgs<Color?> args = new RoutedPropertyChangedEventArgs<Color?>(oldValue, newValue); + args.RoutedEvent = ColorPickerSlider.SelectedColorChangedEvent; + RaiseEvent(args); + } + + #region Base Class Overrides + + public override void OnApplyTemplate() + { + base.OnApplyTemplate(); + + _colorPickerDisplay = (Border)GetTemplateChild(PART_ColorPickerDisplay); + Track track = (Track)GetTemplateChild(PART_Thumb); + if(track != null && track.Thumb != null) + { + track.Thumb.Loaded += TrackLoaded; + } + CreateSpectrum(); + OnValueChanged(Double.NaN, Value); + } + + private void TrackLoaded(object sender, RoutedEventArgs e) + { + Thumb element = (Thumb)sender; + element.Loaded -= TrackLoaded; + _insideThumb = element.FindVisualChildren<Ellipse>().FirstOrDefault(x => x.Name == "PART_InsideThumb"); + } + + protected override void OnValueChanged(double oldValue, double newValue) + { + base.OnValueChanged(oldValue, newValue); + + Color color = ConvertHsvToRgb(newValue, 1, 1); + SelectedColor = color; + if(_insideThumb != null && SelectedColor != null) + { + _insideThumb.Fill = new SolidColorBrush((Color)SelectedColor); + } + } + + #endregion + + #region Events + + public static readonly RoutedEvent SelectedColorChangedEvent = EventManager.RegisterRoutedEvent("SelectedColorChanged", RoutingStrategy.Bubble, typeof(RoutedPropertyChangedEventHandler<Color?>), typeof(ColorPickerSlider)); + public event RoutedPropertyChangedEventHandler<Color?> SelectedColorChanged + { + add + { + AddHandler(SelectedColorChangedEvent, value); + } + remove + { + RemoveHandler(SelectedColorChangedEvent, value); + } + } + + #endregion + #region Methods + + private void CreateSpectrum() + { + this.Minimum = 0; + this.Maximum = 360; + _pickerBrush = new LinearGradientBrush(); + _pickerBrush.ColorInterpolationMode = ColorInterpolationMode.SRgbLinearInterpolation; + + var colorsList = GenerateHsvSpectrum(); + + double stopIncrement = (double)1 / (colorsList.Count - 1); + + int i; + for (i = 0; i < colorsList.Count; i++) + { + var offset = i * stopIncrement; + _pickerBrush.GradientStops.Add(new GradientStop(colorsList[i], i * stopIncrement)); + } + + _pickerBrush.GradientStops[i - 1].Offset = 1.0; + if (_colorPickerDisplay != null) + { + _colorPickerDisplay.Background = _pickerBrush; + } + } + + #endregion //Methods + #region TEST + public static List<Color> GenerateHsvSpectrum() + { + var colorsList = new List<Color>(); + int hStep = 60; + + for (int h = 0; h < 360; h += hStep) + { + colorsList.Add(ConvertHsvToRgb(h, 1, 1)); + } + + colorsList.Add(ConvertHsvToRgb(0, 1, 1)); + + return colorsList; + } + 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))); + } + #endregion + } +} diff --git a/Software/Visual_Studio/Tango.ColorPickers/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.ColorPickers/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..a92d5e36c --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPickers/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Tango.ColorPickers")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Tango.ColorPickers")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file +//inside a <PropertyGroup>. For example, if you are using US english +//in your source files, set the <UICulture> to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[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) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Software/Visual_Studio/Tango.ColorPickers/Properties/Resources.Designer.cs b/Software/Visual_Studio/Tango.ColorPickers/Properties/Resources.Designer.cs new file mode 100644 index 000000000..a0856bb2b --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPickers/Properties/Resources.Designer.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// <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.ColorPickers.Properties { + + + /// <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 ((resourceMan == null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.ColorPickers.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.ColorPickers/Properties/Resources.resx b/Software/Visual_Studio/Tango.ColorPickers/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPickers/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.ColorPickers/Properties/Settings.Designer.cs b/Software/Visual_Studio/Tango.ColorPickers/Properties/Settings.Designer.cs new file mode 100644 index 000000000..4f322957d --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPickers/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// <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.ColorPickers.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.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.ColorPickers/Properties/Settings.settings b/Software/Visual_Studio/Tango.ColorPickers/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPickers/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.ColorPickers/Tango.ColorPickers.csproj b/Software/Visual_Studio/Tango.ColorPickers/Tango.ColorPickers.csproj new file mode 100644 index 000000000..4070aa956 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPickers/Tango.ColorPickers.csproj @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="15.0" 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>{F9DF9435-A4F3-43C5-A6CD-AAD6689B42AE}</ProjectGuid> + <OutputType>library</OutputType> + <RootNamespace>Tango.ColorPickers</RootNamespace> + <AssemblyName>Tango.ColorPickers</AssemblyName> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <WarningLevel>4</WarningLevel> + <Deterministic>true</Deterministic> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\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> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <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="Themes\Generic.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Compile Include="ColorPickerControl.cs" /> + <Compile Include="ColorPickerNumericUpDown.cs" /> + <Compile Include="ColorPickerSlider.cs"> + <SubType>Code</SubType> + </Compile> + </ItemGroup> + <ItemGroup> + <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> + <EmbeddedResource Include="Properties\Resources.resx"> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + </EmbeddedResource> + <None Include="Properties\Settings.settings"> + <Generator>SettingsSingleFileGenerator</Generator> + <LastGenOutput>Settings.Designer.cs</LastGenOutput> + </None> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\SideChains\WpfExtendedToolKit\ExtendedWPFToolkitSolution\Src\Xceed.Wpf.Toolkit\Xceed.Wpf.Toolkit.csproj"> + <Project>{72e591d6-8f83-4d8c-8f67-9c325e623234}</Project> + <Name>Xceed.Wpf.Toolkit</Name> + </ProjectReference> + <ProjectReference Include="..\Tango.Core\Tango.Core.csproj"> + <Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project> + <Name>Tango.Core</Name> + </ProjectReference> + <ProjectReference Include="..\Tango.SharedUI\Tango.SharedUI.csproj"> + <Project>{8491d07b-c1f6-4b62-a412-41b9fd2d6538}</Project> + <Name>Tango.SharedUI</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> +</Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.ColorPickers/Themes/Generic.xaml b/Software/Visual_Studio/Tango.ColorPickers/Themes/Generic.xaml new file mode 100644 index 000000000..5d3046487 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorPickers/Themes/Generic.xaml @@ -0,0 +1,18 @@ +<ResourceDictionary + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:Tango.ColorPickers"> + <Style TargetType="{x:Type local:CustomControl1}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type local:CustomControl1}"> + <Border Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}"> + + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> +</ResourceDictionary> diff --git a/Software/Visual_Studio/Tango.Core/Threading/IntervalMessageDispatcher.cs b/Software/Visual_Studio/Tango.Core/Threading/IntervalMessageDispatcher.cs index ed61bea62..641bd83ac 100644 --- a/Software/Visual_Studio/Tango.Core/Threading/IntervalMessageDispatcher.cs +++ b/Software/Visual_Studio/Tango.Core/Threading/IntervalMessageDispatcher.cs @@ -18,6 +18,8 @@ namespace Tango.Core.Threading private Thread _queueThread; private ProducerConsumerQueue<TMessage> _queue; private Action<TMessage> _onNext; + private long _framesPushed; + private long _framesDelivered; /// <summary> /// Gets or sets the interval. @@ -25,6 +27,24 @@ namespace Tango.Core.Threading public int Interval { get; set; } /// <summary> + /// Gets or sets the drift compensation interval in milliseconds. + /// Meaning, when frames are pushed in a faster rate than delivery interval. + /// This will trigger a compensation mechanism which will deliver frames faster until it reaches balance + /// Between pushed and delivered frames. + /// </summary> + public int? DriftCompensationInterval { get; set; } + + /// <summary> + /// Gets or sets the maximum frames count for drift compensation calculation (default 100). + /// </summary> + public int MaximumFramesForDriftCompensation { get; set; } + + /// <summary> + /// Gets or sets the maximum allowed drift before starting to balance 0-1. default 0.1. + /// </summary> + public double MaximumDrift { get; set; } + + /// <summary> /// Gets a value indicating whether this instance has started. /// </summary> public bool IsStarted { get; private set; } @@ -45,6 +65,8 @@ namespace Tango.Core.Threading { _onNext = onNext; _queue = new ProducerConsumerQueue<TMessage>(); + MaximumDrift = 0.1; + MaximumFramesForDriftCompensation = 100; } /// <summary> @@ -54,6 +76,8 @@ namespace Tango.Core.Threading { if (!IsStarted) { + _framesPushed = 0; + _framesDelivered = 0; IsStarted = true; _queueThread = new Thread(QueueThreadMethod); _queueThread.Name = "Sequencer Thread"; @@ -68,28 +92,70 @@ namespace Tango.Core.Threading /// <param name="message">The message.</param> public void Push(TMessage message) { + _framesPushed++; _queue.BlockEnqueue(message); } private void QueueThreadMethod() { + DateTime lastDriftCompensation = DateTime.Now; + double requiredDriftCompensation = 0; + bool balancing = false; + double balancingFactor = 1; + + Stopwatch watch = new Stopwatch(); watch.Start(); while (IsStarted) { - watch.Restart(); var item = _queue.BlockDequeue(); if (!IsStarted) break; + watch.Restart(); + try { _onNext?.Invoke(item); + _framesDelivered++; } catch { } - Thread.Sleep(Math.Max(1, (int)(Interval - watch.ElapsedMilliseconds))); + //Compensate drift between pushed frames and delivered frames if any. + if (DriftCompensationInterval.HasValue) + { + if (balancing || (DateTime.Now - lastDriftCompensation).TotalMilliseconds > DriftCompensationInterval) + { + lastDriftCompensation = DateTime.Now; + + if (_framesPushed > MaximumFramesForDriftCompensation) + { + var reduction = _framesPushed - MaximumFramesForDriftCompensation; + _framesPushed = MaximumFramesForDriftCompensation; + _framesDelivered = _framesDelivered - reduction; + } + + requiredDriftCompensation = (double)(_framesDelivered / _framesPushed); + + if (1d - requiredDriftCompensation >= MaximumDrift) + { + balancing = true; + balancingFactor = Math.Max(0, balancingFactor - 0.1); + } + else + { + balancing = false; + balancingFactor = 1; + } + + //Debug.WriteLine($"Frames Pushed: {_framesPushed}, Frames Delivered: {_framesDelivered}, Required Compensation: {requiredDriftCompensation}, Balancing: {balancing}, Balancing Factor: {balancingFactor}"); + //Debug.WriteLine("Sleep before: " + (int)(Interval - watch.ElapsedMilliseconds)); + //Debug.WriteLine("Sleep After: " + (int)((Interval - watch.ElapsedMilliseconds) * requiredDriftCompensation * balancingFactor)); + } + } + + Thread.Sleep(Math.Max(0, (int)((Interval - watch.ElapsedMilliseconds) * requiredDriftCompensation * balancingFactor))); } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/PUBLISHED_TEST_PROJECTS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/PUBLISHED_TEST_PROJECTS.cs new file mode 100644 index 000000000..c2a1aa9e0 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/PUBLISHED_TEST_PROJECTS.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// <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 PUBLISHED_TEST_PROJECTS + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public PUBLISHED_TEST_PROJECTS() + { + this.PUBLISHED_TEST_PROJECTS_VERSIONS = new HashSet<PUBLISHED_TEST_PROJECTS_VERSIONS>(); + } + + public int ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public string NAME { get; set; } + public string DESCRIPTION { get; set; } + public System.DateTime PUBLISH_DATE { get; set; } + public bool IS_VISIBLE { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection<PUBLISHED_TEST_PROJECTS_VERSIONS> PUBLISHED_TEST_PROJECTS_VERSIONS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/PUBLISHED_TEST_PROJECTS_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/PUBLISHED_TEST_PROJECTS_VERSIONS.cs new file mode 100644 index 000000000..f41e3317b --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/PUBLISHED_TEST_PROJECTS_VERSIONS.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// <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 PUBLISHED_TEST_PROJECTS_VERSIONS + { + public int ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public string PUBLISHED_TEST_PROJECT_GUID { get; set; } + public int VERSION { get; set; } + public string AUTHOR { get; set; } + public string PROJECT_JSON_STRING { get; set; } + + public virtual PUBLISHED_TEST_PROJECTS PUBLISHED_TEST_PROJECTS { 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 62ae00ce7..7780e4775 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs @@ -83,6 +83,8 @@ namespace Tango.DAL.Remote.DB public virtual DbSet<PERMISSION> PERMISSIONS { get; set; } public virtual DbSet<PROCESS_PARAMETERS_TABLES> PROCESS_PARAMETERS_TABLES { get; set; } public virtual DbSet<PROCESS_PARAMETERS_TABLES_GROUPS> PROCESS_PARAMETERS_TABLES_GROUPS { get; set; } + public virtual DbSet<PUBLISHED_TEST_PROJECTS> PUBLISHED_TEST_PROJECTS { get; set; } + public virtual DbSet<PUBLISHED_TEST_PROJECTS_VERSIONS> PUBLISHED_TEST_PROJECTS_VERSIONS { get; set; } public virtual DbSet<RML> RMLS { get; set; } public virtual DbSet<RMLS_SPOOLS> RMLS_SPOOLS { get; set; } public virtual DbSet<ROLE> ROLES { 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 0a4a052a6..95f9145c0 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -903,6 +903,30 @@ <Property Name="ACTIVE" Type="bit" Nullable="false" /> <Property Name="SAVE_DATE" Type="datetime2" Precision="3" Nullable="false" /> </EntityType> + <EntityType Name="PUBLISHED_TEST_PROJECTS"> + <Key> + <PropertyRef Name="GUID" /> + </Key> + <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" /> + <Property Name="GUID" Type="varchar" MaxLength="36" Nullable="false" /> + <Property Name="LAST_UPDATED" Type="datetime2" Precision="3" Nullable="false" /> + <Property Name="NAME" Type="nvarchar" MaxLength="100" Nullable="false" /> + <Property Name="DESCRIPTION" Type="nvarchar(max)" /> + <Property Name="PUBLISH_DATE" Type="datetime2" Precision="3" Nullable="false" /> + <Property Name="IS_VISIBLE" Type="bit" Nullable="false" /> + </EntityType> + <EntityType Name="PUBLISHED_TEST_PROJECTS_VERSIONS"> + <Key> + <PropertyRef Name="GUID" /> + </Key> + <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" /> + <Property Name="GUID" Type="varchar" MaxLength="36" Nullable="false" /> + <Property Name="LAST_UPDATED" Type="datetime2" Precision="3" Nullable="false" /> + <Property Name="PUBLISHED_TEST_PROJECT_GUID" Type="varchar" MaxLength="36" Nullable="false" /> + <Property Name="VERSION" Type="int" Nullable="false" /> + <Property Name="AUTHOR" Type="nvarchar" MaxLength="200" Nullable="false" /> + <Property Name="PROJECT_JSON_STRING" Type="nvarchar(max)" Nullable="false" /> + </EntityType> <EntityType Name="RMLS"> <Key> <PropertyRef Name="GUID" /> @@ -2024,6 +2048,20 @@ </Dependent> </ReferentialConstraint> </Association> + <Association Name="FK_PUBLISHED_TEST_PROJECTS_VERSIONS_PUBLISHED_TEST_PROJECTS"> + <End Role="PUBLISHED_TEST_PROJECTS" Type="Self.PUBLISHED_TEST_PROJECTS" Multiplicity="1"> + <OnDelete Action="Cascade" /> + </End> + <End Role="PUBLISHED_TEST_PROJECTS_VERSIONS" Type="Self.PUBLISHED_TEST_PROJECTS_VERSIONS" Multiplicity="*" /> + <ReferentialConstraint> + <Principal Role="PUBLISHED_TEST_PROJECTS"> + <PropertyRef Name="GUID" /> + </Principal> + <Dependent Role="PUBLISHED_TEST_PROJECTS_VERSIONS"> + <PropertyRef Name="PUBLISHED_TEST_PROJECT_GUID" /> + </Dependent> + </ReferentialConstraint> + </Association> <Association Name="FK_RML_FIBER_SHAPES"> <End Role="FIBER_SHAPES" Type="Self.FIBER_SHAPES" Multiplicity="1" /> <End Role="RMLS" Type="Self.RMLS" Multiplicity="*" /> @@ -2418,6 +2456,8 @@ <EntitySet Name="PERMISSIONS" EntityType="Self.PERMISSIONS" Schema="dbo" store:Type="Tables" /> <EntitySet Name="PROCESS_PARAMETERS_TABLES" EntityType="Self.PROCESS_PARAMETERS_TABLES" Schema="dbo" store:Type="Tables" /> <EntitySet Name="PROCESS_PARAMETERS_TABLES_GROUPS" EntityType="Self.PROCESS_PARAMETERS_TABLES_GROUPS" Schema="dbo" store:Type="Tables" /> + <EntitySet Name="PUBLISHED_TEST_PROJECTS" EntityType="Self.PUBLISHED_TEST_PROJECTS" Schema="dbo" store:Type="Tables" /> + <EntitySet Name="PUBLISHED_TEST_PROJECTS_VERSIONS" EntityType="Self.PUBLISHED_TEST_PROJECTS_VERSIONS" Schema="dbo" store:Type="Tables" /> <EntitySet Name="RMLS" EntityType="Self.RMLS" Schema="dbo" store:Type="Tables" /> <EntitySet Name="RMLS_SPOOLS" EntityType="Self.RMLS_SPOOLS" Schema="dbo" store:Type="Tables" /> <EntitySet Name="ROLES" EntityType="Self.ROLES" Schema="dbo" store:Type="Tables" /> @@ -2681,6 +2721,10 @@ <End Role="PROCESS_PARAMETERS_TABLES_GROUPS" EntitySet="PROCESS_PARAMETERS_TABLES_GROUPS" /> <End Role="PROCESS_PARAMETERS_TABLES" EntitySet="PROCESS_PARAMETERS_TABLES" /> </AssociationSet> + <AssociationSet Name="FK_PUBLISHED_TEST_PROJECTS_VERSIONS_PUBLISHED_TEST_PROJECTS" Association="Self.FK_PUBLISHED_TEST_PROJECTS_VERSIONS_PUBLISHED_TEST_PROJECTS"> + <End Role="PUBLISHED_TEST_PROJECTS" EntitySet="PUBLISHED_TEST_PROJECTS" /> + <End Role="PUBLISHED_TEST_PROJECTS_VERSIONS" EntitySet="PUBLISHED_TEST_PROJECTS_VERSIONS" /> + </AssociationSet> <AssociationSet Name="FK_RML_FIBER_SHAPES" Association="Self.FK_RML_FIBER_SHAPES"> <End Role="FIBER_SHAPES" EntitySet="FIBER_SHAPES" /> <End Role="RMLS" EntitySet="RMLS" /> @@ -2849,6 +2893,8 @@ <EntitySet Name="PERMISSIONS" EntityType="RemoteModel.PERMISSION" /> <EntitySet Name="PROCESS_PARAMETERS_TABLES" EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES" /> <EntitySet Name="PROCESS_PARAMETERS_TABLES_GROUPS" EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES_GROUPS" /> + <EntitySet Name="PUBLISHED_TEST_PROJECTS" EntityType="RemoteModel.PUBLISHED_TEST_PROJECTS" /> + <EntitySet Name="PUBLISHED_TEST_PROJECTS_VERSIONS" EntityType="RemoteModel.PUBLISHED_TEST_PROJECTS_VERSIONS" /> <EntitySet Name="RMLS" EntityType="RemoteModel.RML" /> <EntitySet Name="RMLS_SPOOLS" EntityType="RemoteModel.RMLS_SPOOLS" /> <EntitySet Name="ROLES" EntityType="RemoteModel.ROLE" /> @@ -3175,6 +3221,10 @@ <End Role="RML" EntitySet="RMLS" /> <End Role="PROCESS_PARAMETERS_TABLES_GROUPS" EntitySet="PROCESS_PARAMETERS_TABLES_GROUPS" /> </AssociationSet> + <AssociationSet Name="FK_PUBLISHED_TEST_PROJECTS_VERSIONS_PUBLISHED_TEST_PROJECTS" Association="RemoteModel.FK_PUBLISHED_TEST_PROJECTS_VERSIONS_PUBLISHED_TEST_PROJECTS"> + <End Role="PUBLISHED_TEST_PROJECTS" EntitySet="PUBLISHED_TEST_PROJECTS" /> + <End Role="PUBLISHED_TEST_PROJECTS_VERSIONS" EntitySet="PUBLISHED_TEST_PROJECTS_VERSIONS" /> + </AssociationSet> <AssociationSet Name="FK_RMLS_SPOOLS_RMLS" Association="RemoteModel.FK_RMLS_SPOOLS_RMLS"> <End Role="RML" EntitySet="RMLS" /> <End Role="RMLS_SPOOLS" EntitySet="RMLS_SPOOLS" /> @@ -4246,6 +4296,32 @@ <NavigationProperty Name="PROCESS_PARAMETERS_TABLES" Relationship="RemoteModel.FK_PROCESS_PARAMETERS_TABLES_PROCESS_PARAMETERS_TABLES_GROUPS" FromRole="PROCESS_PARAMETERS_TABLES_GROUPS" ToRole="PROCESS_PARAMETERS_TABLES" /> <NavigationProperty Name="RML" Relationship="RemoteModel.FK_PROCESS_PARAMETERS_TABLES_GROUPS_RMLS" FromRole="PROCESS_PARAMETERS_TABLES_GROUPS" ToRole="RML" /> </EntityType> + <EntityType Name="PUBLISHED_TEST_PROJECTS"> + <Key> + <PropertyRef Name="GUID" /> + </Key> + <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" /> + <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="NAME" Type="String" Nullable="false" MaxLength="100" FixedLength="false" Unicode="true" /> + <Property Name="DESCRIPTION" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" /> + <Property Name="PUBLISH_DATE" Type="DateTime" Nullable="false" Precision="3" /> + <Property Name="IS_VISIBLE" Type="Boolean" Nullable="false" /> + <NavigationProperty Name="PUBLISHED_TEST_PROJECTS_VERSIONS" Relationship="RemoteModel.FK_PUBLISHED_TEST_PROJECTS_VERSIONS_PUBLISHED_TEST_PROJECTS" FromRole="PUBLISHED_TEST_PROJECTS" ToRole="PUBLISHED_TEST_PROJECTS_VERSIONS" /> + </EntityType> + <EntityType Name="PUBLISHED_TEST_PROJECTS_VERSIONS"> + <Key> + <PropertyRef Name="GUID" /> + </Key> + <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" /> + <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="PUBLISHED_TEST_PROJECT_GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> + <Property Name="VERSION" Type="Int32" Nullable="false" /> + <Property Name="AUTHOR" Type="String" Nullable="false" MaxLength="200" FixedLength="false" Unicode="true" /> + <Property Name="PROJECT_JSON_STRING" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" /> + <NavigationProperty Name="PUBLISHED_TEST_PROJECTS" Relationship="RemoteModel.FK_PUBLISHED_TEST_PROJECTS_VERSIONS_PUBLISHED_TEST_PROJECTS" FromRole="PUBLISHED_TEST_PROJECTS_VERSIONS" ToRole="PUBLISHED_TEST_PROJECTS" /> + </EntityType> <EntityType Name="RML"> <Key> <PropertyRef Name="GUID" /> @@ -5607,6 +5683,20 @@ </Dependent> </ReferentialConstraint> </Association> + <Association Name="FK_PUBLISHED_TEST_PROJECTS_VERSIONS_PUBLISHED_TEST_PROJECTS"> + <End Type="RemoteModel.PUBLISHED_TEST_PROJECTS" Role="PUBLISHED_TEST_PROJECTS" Multiplicity="1"> + <OnDelete Action="Cascade" /> + </End> + <End Type="RemoteModel.PUBLISHED_TEST_PROJECTS_VERSIONS" Role="PUBLISHED_TEST_PROJECTS_VERSIONS" Multiplicity="*" /> + <ReferentialConstraint> + <Principal Role="PUBLISHED_TEST_PROJECTS"> + <PropertyRef Name="GUID" /> + </Principal> + <Dependent Role="PUBLISHED_TEST_PROJECTS_VERSIONS"> + <PropertyRef Name="PUBLISHED_TEST_PROJECT_GUID" /> + </Dependent> + </ReferentialConstraint> + </Association> <Association Name="FK_RMLS_SPOOLS_RMLS"> <End Type="RemoteModel.RML" Role="RML" Multiplicity="1"> <OnDelete Action="Cascade" /> @@ -6713,6 +6803,32 @@ </MappingFragment> </EntityTypeMapping> </EntitySetMapping> + <EntitySetMapping Name="PUBLISHED_TEST_PROJECTS"> + <EntityTypeMapping TypeName="RemoteModel.PUBLISHED_TEST_PROJECTS"> + <MappingFragment StoreEntitySet="PUBLISHED_TEST_PROJECTS"> + <ScalarProperty Name="IS_VISIBLE" ColumnName="IS_VISIBLE" /> + <ScalarProperty Name="PUBLISH_DATE" ColumnName="PUBLISH_DATE" /> + <ScalarProperty Name="DESCRIPTION" ColumnName="DESCRIPTION" /> + <ScalarProperty Name="NAME" ColumnName="NAME" /> + <ScalarProperty Name="LAST_UPDATED" ColumnName="LAST_UPDATED" /> + <ScalarProperty Name="GUID" ColumnName="GUID" /> + <ScalarProperty Name="ID" ColumnName="ID" /> + </MappingFragment> + </EntityTypeMapping> + </EntitySetMapping> + <EntitySetMapping Name="PUBLISHED_TEST_PROJECTS_VERSIONS"> + <EntityTypeMapping TypeName="RemoteModel.PUBLISHED_TEST_PROJECTS_VERSIONS"> + <MappingFragment StoreEntitySet="PUBLISHED_TEST_PROJECTS_VERSIONS"> + <ScalarProperty Name="PROJECT_JSON_STRING" ColumnName="PROJECT_JSON_STRING" /> + <ScalarProperty Name="AUTHOR" ColumnName="AUTHOR" /> + <ScalarProperty Name="VERSION" ColumnName="VERSION" /> + <ScalarProperty Name="PUBLISHED_TEST_PROJECT_GUID" ColumnName="PUBLISHED_TEST_PROJECT_GUID" /> + <ScalarProperty Name="LAST_UPDATED" ColumnName="LAST_UPDATED" /> + <ScalarProperty Name="GUID" ColumnName="GUID" /> + <ScalarProperty Name="ID" ColumnName="ID" /> + </MappingFragment> + </EntityTypeMapping> + </EntitySetMapping> <EntitySetMapping Name="RMLS"> <EntityTypeMapping TypeName="RemoteModel.RML"> <MappingFragment StoreEntitySet="RMLS"> 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 93f29852f..6762b69a4 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -4,86 +4,88 @@ <edmx:Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx"> <!-- Diagram content (shape and connector positions) --> <edmx:Diagrams> - <Diagram DiagramId="f9ae01d708754bbd997add25a4bacc79" Name="Diagram1"> - <EntityTypeShape EntityType="RemoteModel.ACTION_LOGS" Width="1.5" PointX="5.25" PointY="36.625" /> - <EntityTypeShape EntityType="RemoteModel.ADDRESS" Width="1.5" PointX="4.5" PointY="79.375" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_DISPLAY_PANEL_VERSIONS" Width="1.5" PointX="4.5" PointY="63.375" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_FIRMWARE_VERSIONS" Width="1.5" PointX="4.5" PointY="66.25" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_OS_VERSIONS" Width="1.5" PointX="4.5" PointY="60.5" /> - <EntityTypeShape EntityType="RemoteModel.BRUSH_STOPS" Width="1.5" PointX="10.75" PointY="25" /> - <EntityTypeShape EntityType="RemoteModel.CARTRIDGE_TYPES" Width="1.5" PointX="11" PointY="79.25" /> - <EntityTypeShape EntityType="RemoteModel.CAT" Width="1.5" PointX="11.25" PointY="15.875" /> - <EntityTypeShape EntityType="RemoteModel.CCT" Width="1.5" PointX="0.75" PointY="20.125" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS" Width="1.5" PointX="3" PointY="5" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_GROUPS" Width="1.5" PointX="6.25" PointY="33.125" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_ITEMS" Width="1.5" PointX="8.5" PointY="31.875" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_ITEMS_RECIPES" Width="1.5" PointX="8.25" PointY="23.75" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_SPACES" Width="1.5" PointX="3" PointY="9.5" /> - <EntityTypeShape EntityType="RemoteModel.CONFIGURATION" Width="1.5" PointX="6.75" PointY="61.75" /> - <EntityTypeShape EntityType="RemoteModel.CONTACT" Width="1.5" PointX="4.5" PointY="75.5" /> - <EntityTypeShape EntityType="RemoteModel.CUSTOMER" Width="1.5" PointX="3" PointY="43" /> - <EntityTypeShape EntityType="RemoteModel.DISPENSER_TYPES" Width="1.5" PointX="8.75" PointY="8.125" /> - <EntityTypeShape EntityType="RemoteModel.DISPENSER" Width="1.5" PointX="11" PointY="7.5" /> - <EntityTypeShape EntityType="RemoteModel.EMBEDDED_FIRMWARE_VERSIONS" Width="1.5" PointX="4.5" PointY="69.25" /> - <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES" Width="1.5" PointX="13" PointY="66" /> - <EntityTypeShape EntityType="RemoteModel.FIBER_SHAPES" Width="1.5" PointX="0.75" PointY="13" /> - <EntityTypeShape EntityType="RemoteModel.FIBER_SYNTHS" Width="1.5" PointX="0.75" PointY="23.875" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_BLOWER_TYPES" Width="1.5" PointX="7.5" PointY="42.75" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_BLOWERS" Width="1.5" PointX="9.75" PointY="52.375" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_BREAK_SENSOR_TYPES" Width="1.5" PointX="7.5" PointY="81.75" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_BREAK_SENSORS" Width="1.5" PointX="9.75" PointY="60.5" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCER_TYPES" Width="1.5" PointX="4.5" PointY="83.75" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCERS" Width="1.5" PointX="6.75" PointY="55.75" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTOR_TYPES" Width="1.5" PointX="13.5" PointY="62.625" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTORS" Width="1.5" PointX="15.75" PointY="53.5" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROL_TYPES" Width="1.5" PointX="10.5" PointY="74.75" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROLS" Width="1.5" PointX="12.75" PointY="54.875" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSOR_TYPES" Width="1.5" PointX="7.5" PointY="38.75" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSORS" Width="1.5" PointX="9.75" PointY="56.5" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_VERSIONS" Width="1.5" PointX="4.5" PointY="56.25" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDER_TYPES" Width="1.5" PointX="10.5" PointY="41.75" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDERS" Width="1.5" PointX="12.75" PointY="50.625" /> - <EntityTypeShape EntityType="RemoteModel.IDS_PACK_FORMULAS" Width="1.5" PointX="11" PointY="37.875" /> - <EntityTypeShape EntityType="RemoteModel.IDS_PACKS" Width="1.5" PointX="13.25" PointY="31.875" /> - <EntityTypeShape EntityType="RemoteModel.JOB_RUNS" Width="1.5" PointX="5.75" PointY="4.75" /> - <EntityTypeShape EntityType="RemoteModel.JOB" Width="1.5" PointX="5.25" PointY="16.375" /> - <EntityTypeShape EntityType="RemoteModel.LINEAR_MASS_DENSITY_UNITS" Width="1.5" PointX="0.75" PointY="29.75" /> - <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES" Width="1.5" PointX="9" PointY="2.125" /> - <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES_RMLS" Width="1.5" PointX="8.25" PointY="16" /> - <EntityTypeShape EntityType="RemoteModel.MACHINE_STUDIO_VERSIONS" Width="1.5" PointX="5.25" PointY="44.375" /> - <EntityTypeShape EntityType="RemoteModel.MACHINE_VERSIONS" Width="1.5" PointX="6.75" PointY="72.125" /> - <EntityTypeShape EntityType="RemoteModel.MACHINE" Width="1.5" PointX="9" PointY="65" /> - <EntityTypeShape EntityType="RemoteModel.MACHINES_EVENTS" Width="1.5" PointX="15.25" PointY="48.25" /> - <EntityTypeShape EntityType="RemoteModel.MEDIA_CONDITIONS" Width="1.5" PointX="0.75" PointY="15.875" /> - <EntityTypeShape EntityType="RemoteModel.MEDIA_MATERIALS" Width="1.5" PointX="0.75" PointY="32.625" /> - <EntityTypeShape EntityType="RemoteModel.MEDIA_PURPOSES" Width="1.5" PointX="0.75" PointY="26.75" /> - <EntityTypeShape EntityType="RemoteModel.MID_TANK_TYPES" Width="1.5" PointX="11" PointY="34.875" /> - <EntityTypeShape EntityType="RemoteModel.ORGANIZATION" Width="1.5" PointX="6.75" PointY="77.375" /> - <EntityTypeShape EntityType="RemoteModel.PERMISSION" Width="1.5" PointX="3" PointY="87.5" /> - <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES" Width="1.5" PointX="7.5" PointY="46.625" /> - <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES_GROUPS" Width="1.5" PointX="5.25" PointY="49.25" /> + <Diagram DiagramId="f9ae01d708754bbd997add25a4bacc79" Name="Diagram1" ZoomLevel="97"> + <EntityTypeShape EntityType="RemoteModel.ACTION_LOGS" Width="1.5" PointX="11.25" PointY="7.875" /> + <EntityTypeShape EntityType="RemoteModel.ADDRESS" Width="1.5" PointX="4.5" PointY="45.625" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_DISPLAY_PANEL_VERSIONS" Width="1.5" PointX="4.5" PointY="61.125" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_FIRMWARE_VERSIONS" Width="1.5" PointX="4.5" PointY="68.25" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_OS_VERSIONS" Width="1.5" PointX="4.5" PointY="58.125" /> + <EntityTypeShape EntityType="RemoteModel.BRUSH_STOPS" Width="1.5" PointX="15.75" PointY="17" /> + <EntityTypeShape EntityType="RemoteModel.CARTRIDGE_TYPES" Width="1.5" PointX="7.75" PointY="32.375" /> + <EntityTypeShape EntityType="RemoteModel.CAT" Width="1.5" PointX="5.25" PointY="23.875" /> + <EntityTypeShape EntityType="RemoteModel.CCT" Width="1.5" PointX="0.75" PointY="12.75" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS" Width="1.5" PointX="1.5" PointY="1.625" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_GROUPS" Width="1.5" PointX="0.75" PointY="8.125" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_ITEMS" Width="1.5" PointX="3" PointY="6.875" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_ITEMS_RECIPES" Width="1.5" PointX="5.25" PointY="15.75" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_SPACES" Width="1.5" PointX="9" PointY="11.625" /> + <EntityTypeShape EntityType="RemoteModel.CONFIGURATION" Width="1.5" PointX="6.75" PointY="60.75" /> + <EntityTypeShape EntityType="RemoteModel.CONTACT" Width="1.5" PointX="4.5" PointY="49.75" /> + <EntityTypeShape EntityType="RemoteModel.CUSTOMER" Width="1.5" PointX="9" PointY="48.125" /> + <EntityTypeShape EntityType="RemoteModel.DISPENSER_TYPES" Width="1.5" PointX="5.5" PointY="75.875" /> + <EntityTypeShape EntityType="RemoteModel.DISPENSER" Width="1.5" PointX="7.75" PointY="75.25" /> + <EntityTypeShape EntityType="RemoteModel.EMBEDDED_FIRMWARE_VERSIONS" Width="1.5" PointX="4.5" PointY="55.25" /> + <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES" Width="1.5" PointX="9" PointY="27.5" /> + <EntityTypeShape EntityType="RemoteModel.FIBER_SHAPES" Width="1.5" PointX="0.75" PointY="16.125" /> + <EntityTypeShape EntityType="RemoteModel.FIBER_SYNTHS" Width="1.5" PointX="0.75" PointY="29.875" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_BLOWER_TYPES" Width="1.5" PointX="9.5" PointY="83.625" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_BLOWERS" Width="1.5" PointX="11.75" PointY="69.25" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_BREAK_SENSOR_TYPES" Width="1.5" PointX="4.5" PointY="71.625" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_BREAK_SENSORS" Width="1.5" PointX="6.75" PointY="56.25" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCER_TYPES" Width="1.5" PointX="9.5" PointY="70.625" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCERS" Width="1.5" PointX="11.75" PointY="63.5" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTOR_TYPES" Width="1.5" PointX="12.5" PointY="73.5" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTORS" Width="1.5" PointX="14.75" PointY="61.25" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROL_TYPES" Width="1.5" PointX="12.5" PointY="55.625" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROLS" Width="1.5" PointX="14.75" PointY="53.625" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSOR_TYPES" Width="1.5" PointX="9.5" PointY="56.625" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSORS" Width="1.5" PointX="11.75" PointY="59.25" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_VERSIONS" Width="1.5" PointX="4.5" PointY="64" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDER_TYPES" Width="1.5" PointX="4.5" PointY="79.625" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDERS" Width="1.5" PointX="6.75" PointY="66.375" /> + <EntityTypeShape EntityType="RemoteModel.IDS_PACK_FORMULAS" Width="1.5" PointX="7.75" PointY="52.625" /> + <EntityTypeShape EntityType="RemoteModel.IDS_PACKS" Width="1.5" PointX="10" PointY="42.625" /> + <EntityTypeShape EntityType="RemoteModel.JOB_RUNS" Width="1.5" PointX="5.75" PointY="0.75" /> + <EntityTypeShape EntityType="RemoteModel.JOB" Width="1.5" PointX="11.25" PointY="16.375" /> + <EntityTypeShape EntityType="RemoteModel.LINEAR_MASS_DENSITY_UNITS" Width="1.5" PointX="0.75" PointY="24" /> + <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES" Width="1.5" PointX="3" PointY="28.75" /> + <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES_RMLS" Width="1.5" PointX="5.25" PointY="20" /> + <EntityTypeShape EntityType="RemoteModel.MACHINE_STUDIO_VERSIONS" Width="1.5" PointX="11.25" PointY="1.25" /> + <EntityTypeShape EntityType="RemoteModel.MACHINE_VERSIONS" Width="1.5" PointX="6.75" PointY="71.25" /> + <EntityTypeShape EntityType="RemoteModel.MACHINE" Width="1.5" PointX="9" PointY="60" /> + <EntityTypeShape EntityType="RemoteModel.MACHINES_EVENTS" Width="1.5" PointX="11.25" PointY="33.75" /> + <EntityTypeShape EntityType="RemoteModel.MEDIA_CONDITIONS" Width="1.5" PointX="0.75" PointY="32.75" /> + <EntityTypeShape EntityType="RemoteModel.MEDIA_MATERIALS" Width="1.5" PointX="0.75" PointY="20.25" /> + <EntityTypeShape EntityType="RemoteModel.MEDIA_PURPOSES" Width="1.5" PointX="0.75" PointY="27" /> + <EntityTypeShape EntityType="RemoteModel.MID_TANK_TYPES" Width="1.5" PointX="7.75" PointY="79.875" /> + <EntityTypeShape EntityType="RemoteModel.ORGANIZATION" Width="1.5" PointX="6.75" PointY="47.625" /> + <EntityTypeShape EntityType="RemoteModel.PERMISSION" Width="1.5" PointX="12" PointY="48.25" /> + <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES" Width="1.5" PointX="7.5" PointY="35.75" /> + <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES_GROUPS" Width="1.5" PointX="5.25" PointY="38.5" /> + <EntityTypeShape EntityType="RemoteModel.PUBLISHED_TEST_PROJECTS" Width="1.5" PointX="13.75" PointY="7" /> + <EntityTypeShape EntityType="RemoteModel.PUBLISHED_TEST_PROJECTS_VERSIONS" Width="1.5" PointX="16" PointY="7" /> <EntityTypeShape EntityType="RemoteModel.RML" Width="1.5" PointX="3" PointY="15.25" /> - <EntityTypeShape EntityType="RemoteModel.RMLS_SPOOLS" Width="1.5" PointX="8.25" PointY="19.875" /> - <EntityTypeShape EntityType="RemoteModel.ROLE" Width="1.5" PointX="3" PointY="1.375" /> - <EntityTypeShape EntityType="RemoteModel.ROLES_PERMISSIONS" Width="1.5" PointX="5.25" PointY="1.5" /> - <EntityTypeShape EntityType="RemoteModel.SEGMENT" Width="1.5" PointX="7.5" PointY="28" /> - <EntityTypeShape EntityType="RemoteModel.SITE" Width="1.5" PointX="9" PointY="12" /> - <EntityTypeShape EntityType="RemoteModel.SITES_CATALOGS" Width="1.5" PointX="13.25" PointY="8.625" /> - <EntityTypeShape EntityType="RemoteModel.SITES_RMLS" Width="1.5" PointX="11.25" PointY="20.25" /> - <EntityTypeShape EntityType="RemoteModel.SPOOL_TYPES" Width="1.5" PointX="3" PointY="29.25" /> - <EntityTypeShape EntityType="RemoteModel.SPOOL" Width="1.5" PointX="11.25" PointY="45.875" /> - <EntityTypeShape EntityType="RemoteModel.sysdiagram" Width="1.5" PointX="11.75" PointY="0.75" /> - <EntityTypeShape EntityType="RemoteModel.TANGO_UPDATES" Width="1.5" PointX="13.75" PointY="0.75" /> - <EntityTypeShape EntityType="RemoteModel.TANGO_VERSIONS" Width="1.5" PointX="18" PointY="52.875" /> - <EntityTypeShape EntityType="RemoteModel.TECH_CONTROLLERS" Width="1.5" PointX="13.75" PointY="12.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_DISPENSERS" Width="1.5" PointX="5.75" PointY="12.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_HEATERS" Width="1.5" PointX="13.75" PointY="5.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_IOS" Width="1.5" PointX="15.75" PointY="0.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_MONITORS" Width="1.5" PointX="15.75" PointY="5.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_VALVES" Width="1.5" PointX="15.75" PointY="10.75" /> - <EntityTypeShape EntityType="RemoteModel.USER" Width="1.5" PointX="3" PointY="34.25" /> - <EntityTypeShape EntityType="RemoteModel.USERS_ROLES" Width="1.5" PointX="5.25" PointY="40.5" /> - <EntityTypeShape EntityType="RemoteModel.WINDING_METHODS" Width="1.5" PointX="3" PointY="39.875" /> + <EntityTypeShape EntityType="RemoteModel.RMLS_SPOOLS" Width="1.5" PointX="8.25" PointY="15.875" /> + <EntityTypeShape EntityType="RemoteModel.ROLE" Width="1.5" PointX="12" PointY="27.25" /> + <EntityTypeShape EntityType="RemoteModel.ROLES_PERMISSIONS" Width="1.5" PointX="14.25" PointY="27.25" /> + <EntityTypeShape EntityType="RemoteModel.SEGMENT" Width="1.5" PointX="13.5" PointY="20" /> + <EntityTypeShape EntityType="RemoteModel.SITE" Width="1.5" PointX="6" PointY="28" /> + <EntityTypeShape EntityType="RemoteModel.SITES_CATALOGS" Width="1.5" PointX="11.25" PointY="13" /> + <EntityTypeShape EntityType="RemoteModel.SITES_RMLS" Width="1.5" PointX="8.25" PointY="20.25" /> + <EntityTypeShape EntityType="RemoteModel.SPOOL_TYPES" Width="1.5" PointX="6" PointY="10.25" /> + <EntityTypeShape EntityType="RemoteModel.SPOOL" Width="1.5" PointX="12.25" PointY="38.875" /> + <EntityTypeShape EntityType="RemoteModel.sysdiagram" Width="1.5" PointX="13.75" PointY="10.75" /> + <EntityTypeShape EntityType="RemoteModel.TANGO_UPDATES" Width="1.5" PointX="15.75" PointY="10.75" /> + <EntityTypeShape EntityType="RemoteModel.TANGO_VERSIONS" Width="1.5" PointX="14.25" PointY="34.25" /> + <EntityTypeShape EntityType="RemoteModel.TECH_CONTROLLERS" Width="1.5" PointX="16.75" PointY="0.75" /> + <EntityTypeShape EntityType="RemoteModel.TECH_DISPENSERS" Width="1.5" PointX="17.75" PointY="10.75" /> + <EntityTypeShape EntityType="RemoteModel.TECH_HEATERS" Width="1.5" PointX="17.75" PointY="13.75" /> + <EntityTypeShape EntityType="RemoteModel.TECH_IOS" Width="1.5" PointX="17.75" PointY="16.75" /> + <EntityTypeShape EntityType="RemoteModel.TECH_MONITORS" Width="1.5" PointX="18.75" PointY="0.75" /> + <EntityTypeShape EntityType="RemoteModel.TECH_VALVES" Width="1.5" PointX="18.75" PointY="5.75" /> + <EntityTypeShape EntityType="RemoteModel.USER" Width="1.5" PointX="9" PointY="2" /> + <EntityTypeShape EntityType="RemoteModel.USERS_ROLES" Width="1.5" PointX="14.25" PointY="3.25" /> + <EntityTypeShape EntityType="RemoteModel.WINDING_METHODS" Width="1.5" PointX="9" PointY="24.125" /> <AssociationConnector Association="RemoteModel.FK_ACTION_LOGS_USERS" /> <AssociationConnector Association="RemoteModel.FK_ORGANIZATIONS_ADDRESSES" /> <AssociationConnector Association="RemoteModel.FK_USERS_ADDRESSES" /> @@ -160,6 +162,7 @@ <AssociationConnector Association="RemoteModel.FK_ROLES_PERMISSIONS_PERMISSIONS" /> <AssociationConnector Association="RemoteModel.FK_PROCESS_PARAMETERS_TABLES_PROCESS_PARAMETERS_TABLES_GROUPS" /> <AssociationConnector Association="RemoteModel.FK_PROCESS_PARAMETERS_TABLES_GROUPS_RMLS" /> + <AssociationConnector Association="RemoteModel.FK_PUBLISHED_TEST_PROJECTS_VERSIONS_PUBLISHED_TEST_PROJECTS" /> <AssociationConnector Association="RemoteModel.FK_RMLS_SPOOLS_RMLS" /> <AssociationConnector Association="RemoteModel.FK_SITES_RMLS_RMLS" /> <AssociationConnector Association="RemoteModel.FK_RMLS_SPOOLS_SPOOL_TYPES" /> 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 7ea9a77a7..9af2b83a1 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj +++ b/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj @@ -237,6 +237,12 @@ <Compile Include="DB\PROCESS_PARAMETERS_TABLES_GROUPS.cs"> <DependentUpon>RemoteADO.tt</DependentUpon> </Compile> + <Compile Include="DB\PUBLISHED_TEST_PROJECTS.cs"> + <DependentUpon>RemoteADO.tt</DependentUpon> + </Compile> + <Compile Include="DB\PUBLISHED_TEST_PROJECTS_VERSIONS.cs"> + <DependentUpon>RemoteADO.tt</DependentUpon> + </Compile> <Compile Include="DB\RemoteADO.Context.cs"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> @@ -371,7 +377,7 @@ </Target> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index 42a1902e4..419e5adb8 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -456,6 +456,8 @@ namespace Tango.Emulations.Emulators Transporter.SendResponse(res); } + + Transporter.SendResponse(new ProgressResponse(), request.Container.Token, new TransportResponseConfig() { Completed = true }); }); } diff --git a/Software/Visual_Studio/Tango.FSE.sln b/Software/Visual_Studio/Tango.FSE.sln new file mode 100644 index 000000000..990e2328b --- /dev/null +++ b/Software/Visual_Studio/Tango.FSE.sln @@ -0,0 +1,111 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.645 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FSE", "FSE", "{C3E55397-70D9-4850-81A5-CBBCDCF4C192}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{DBE903D1-1D6C-4B0D-8EB1-CCB447FA1775}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.FSE.BL", "FSE\Tango.FSE.BL\Tango.FSE.BL.csproj", "{834C81C3-09B5-45D7-BE12-E7D1E6655A7C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.FSE.Common", "FSE\Tango.FSE.Common\Tango.FSE.Common.csproj", "{BC37CCCB-7392-4F78-8D1C-E9629E6E046E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.FSE.Web", "FSE\Tango.FSE.Web\Tango.FSE.Web.csproj", "{D6F7D31D-7F8C-45E2-AE0A-FBBD1F5F9D5F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.FSE.UI", "FSE\Tango.FSE.UI\Tango.FSE.UI.csproj", "{26C54A4F-315D-4B79-B163-EDDDE8F93A86}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.FSE.Diagnostics", "FSE\Modules\Tango.FSE.Diagnostics\Tango.FSE.Diagnostics.csproj", "{8CFFA4FC-F46F-475D-A270-DAFBFB532BC8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.FSE.Firmware", "FSE\Modules\Tango.FSE.Firmware\Tango.FSE.Firmware.csproj", "{7CB96D74-8B71-4A81-B4E1-6DE7BFCA6174}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.FSE.PPCConsole", "FSE\Modules\Tango.FSE.PPCConsole\Tango.FSE.PPCConsole.csproj", "{866B916A-207C-43F0-B403-7C4A820C2E11}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.FSE.Stubs", "FSE\Modules\Tango.FSE.Stubs\Tango.FSE.Stubs.csproj", "{1754F846-4763-4000-807F-C7BFAA145DB2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.FSE.Upgrade", "FSE\Modules\Tango.FSE.Upgrade\Tango.FSE.Upgrade.csproj", "{0C0B24CB-79AF-4253-AAC3-B2BADF034675}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.SharedUI", "Tango.SharedUI\Tango.SharedUI.csproj", "{8491D07B-C1F6-4B62-A412-41B9FD2D6538}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripting", "Scripting", "{6341BAC2-F9BE-4F10-BB13-DC4D59DD7B00}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Scripting.Editors", "Scripting\Tango.Scripting.Editors\Tango.Scripting.Editors.csproj", "{DA62FA39-668B-47A6-B0F2-D2C1DAF777B0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Scripting.Basic", "Scripting\Tango.Scripting.Basic\Tango.Scripting.Basic.csproj", "{2B29A699-1D65-463A-8250-A2CE81D019C9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {834C81C3-09B5-45D7-BE12-E7D1E6655A7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {834C81C3-09B5-45D7-BE12-E7D1E6655A7C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {834C81C3-09B5-45D7-BE12-E7D1E6655A7C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {834C81C3-09B5-45D7-BE12-E7D1E6655A7C}.Release|Any CPU.Build.0 = Release|Any CPU + {BC37CCCB-7392-4F78-8D1C-E9629E6E046E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BC37CCCB-7392-4F78-8D1C-E9629E6E046E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BC37CCCB-7392-4F78-8D1C-E9629E6E046E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BC37CCCB-7392-4F78-8D1C-E9629E6E046E}.Release|Any CPU.Build.0 = Release|Any CPU + {D6F7D31D-7F8C-45E2-AE0A-FBBD1F5F9D5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D6F7D31D-7F8C-45E2-AE0A-FBBD1F5F9D5F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D6F7D31D-7F8C-45E2-AE0A-FBBD1F5F9D5F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D6F7D31D-7F8C-45E2-AE0A-FBBD1F5F9D5F}.Release|Any CPU.Build.0 = Release|Any CPU + {26C54A4F-315D-4B79-B163-EDDDE8F93A86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {26C54A4F-315D-4B79-B163-EDDDE8F93A86}.Debug|Any CPU.Build.0 = Debug|Any CPU + {26C54A4F-315D-4B79-B163-EDDDE8F93A86}.Release|Any CPU.ActiveCfg = Release|Any CPU + {26C54A4F-315D-4B79-B163-EDDDE8F93A86}.Release|Any CPU.Build.0 = Release|Any CPU + {8CFFA4FC-F46F-475D-A270-DAFBFB532BC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8CFFA4FC-F46F-475D-A270-DAFBFB532BC8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8CFFA4FC-F46F-475D-A270-DAFBFB532BC8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8CFFA4FC-F46F-475D-A270-DAFBFB532BC8}.Release|Any CPU.Build.0 = Release|Any CPU + {7CB96D74-8B71-4A81-B4E1-6DE7BFCA6174}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7CB96D74-8B71-4A81-B4E1-6DE7BFCA6174}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7CB96D74-8B71-4A81-B4E1-6DE7BFCA6174}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7CB96D74-8B71-4A81-B4E1-6DE7BFCA6174}.Release|Any CPU.Build.0 = Release|Any CPU + {866B916A-207C-43F0-B403-7C4A820C2E11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {866B916A-207C-43F0-B403-7C4A820C2E11}.Debug|Any CPU.Build.0 = Debug|Any CPU + {866B916A-207C-43F0-B403-7C4A820C2E11}.Release|Any CPU.ActiveCfg = Release|Any CPU + {866B916A-207C-43F0-B403-7C4A820C2E11}.Release|Any CPU.Build.0 = Release|Any CPU + {1754F846-4763-4000-807F-C7BFAA145DB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1754F846-4763-4000-807F-C7BFAA145DB2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1754F846-4763-4000-807F-C7BFAA145DB2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1754F846-4763-4000-807F-C7BFAA145DB2}.Release|Any CPU.Build.0 = Release|Any CPU + {0C0B24CB-79AF-4253-AAC3-B2BADF034675}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0C0B24CB-79AF-4253-AAC3-B2BADF034675}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0C0B24CB-79AF-4253-AAC3-B2BADF034675}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0C0B24CB-79AF-4253-AAC3-B2BADF034675}.Release|Any CPU.Build.0 = Release|Any CPU + {8491D07B-C1F6-4B62-A412-41B9FD2D6538}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8491D07B-C1F6-4B62-A412-41B9FD2D6538}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8491D07B-C1F6-4B62-A412-41B9FD2D6538}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8491D07B-C1F6-4B62-A412-41B9FD2D6538}.Release|Any CPU.Build.0 = Release|Any CPU + {DA62FA39-668B-47A6-B0F2-D2C1DAF777B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DA62FA39-668B-47A6-B0F2-D2C1DAF777B0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DA62FA39-668B-47A6-B0F2-D2C1DAF777B0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DA62FA39-668B-47A6-B0F2-D2C1DAF777B0}.Release|Any CPU.Build.0 = Release|Any CPU + {2B29A699-1D65-463A-8250-A2CE81D019C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2B29A699-1D65-463A-8250-A2CE81D019C9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2B29A699-1D65-463A-8250-A2CE81D019C9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2B29A699-1D65-463A-8250-A2CE81D019C9}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {DBE903D1-1D6C-4B0D-8EB1-CCB447FA1775} = {C3E55397-70D9-4850-81A5-CBBCDCF4C192} + {834C81C3-09B5-45D7-BE12-E7D1E6655A7C} = {C3E55397-70D9-4850-81A5-CBBCDCF4C192} + {BC37CCCB-7392-4F78-8D1C-E9629E6E046E} = {C3E55397-70D9-4850-81A5-CBBCDCF4C192} + {D6F7D31D-7F8C-45E2-AE0A-FBBD1F5F9D5F} = {C3E55397-70D9-4850-81A5-CBBCDCF4C192} + {26C54A4F-315D-4B79-B163-EDDDE8F93A86} = {C3E55397-70D9-4850-81A5-CBBCDCF4C192} + {8CFFA4FC-F46F-475D-A270-DAFBFB532BC8} = {DBE903D1-1D6C-4B0D-8EB1-CCB447FA1775} + {7CB96D74-8B71-4A81-B4E1-6DE7BFCA6174} = {DBE903D1-1D6C-4B0D-8EB1-CCB447FA1775} + {866B916A-207C-43F0-B403-7C4A820C2E11} = {DBE903D1-1D6C-4B0D-8EB1-CCB447FA1775} + {1754F846-4763-4000-807F-C7BFAA145DB2} = {DBE903D1-1D6C-4B0D-8EB1-CCB447FA1775} + {0C0B24CB-79AF-4253-AAC3-B2BADF034675} = {DBE903D1-1D6C-4B0D-8EB1-CCB447FA1775} + {DA62FA39-668B-47A6-B0F2-D2C1DAF777B0} = {6341BAC2-F9BE-4F10-BB13-DC4D59DD7B00} + {2B29A699-1D65-463A-8250-A2CE81D019C9} = {6341BAC2-F9BE-4F10-BB13-DC4D59DD7B00} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {44758539-3458-4A3E-89DD-68F496B34B45} + EndGlobalSection +EndGlobal diff --git a/Software/Visual_Studio/Tango.Integration/Storage/StorageItem.cs b/Software/Visual_Studio/Tango.Integration/Storage/StorageItem.cs index eb7e56adb..6894f7111 100644 --- a/Software/Visual_Studio/Tango.Integration/Storage/StorageItem.cs +++ b/Software/Visual_Studio/Tango.Integration/Storage/StorageItem.cs @@ -22,11 +22,12 @@ namespace Tango.Integration.Storage { get { return System.IO.Path.GetFileName(Path); } } + public String Parent { get { - if (Path == "/") return null; + if (Path == "/" || Path == null) return null; String root = System.IO.Path.GetPathRoot(Path); var parent = Directory.GetParent(Path); diff --git a/Software/Visual_Studio/Tango.Integration/Storage/StorageManager.cs b/Software/Visual_Studio/Tango.Integration/Storage/StorageManager.cs index 2cc95e4a6..64d246f9d 100644 --- a/Software/Visual_Studio/Tango.Integration/Storage/StorageManager.cs +++ b/Software/Visual_Studio/Tango.Integration/Storage/StorageManager.cs @@ -253,7 +253,7 @@ namespace Tango.Integration.Storage chunk.Path = path; chunk.Buffer = ByteString.CopyFrom(buffer); - var chunk_response = _transporter.SendRequest<FileChunkUploadRequest, FileChunkUploadResponse>(chunk).Result; + var chunk_response = _transporter.SendRequest<FileChunkUploadRequest, FileChunkUploadResponse>(chunk,new TransportRequestConfig() { Priority = QueuePriority.Low }).Result; if (chunk_response.Message.IsCanceled) { @@ -355,7 +355,7 @@ namespace Tango.Integration.Storage chunk.FileName = file.Path; chunk.Position = stream.Length; - var chunk_response = _transporter.SendRequest<FileChunkDownloadRequest, FileChunkDownloadResponse>(chunk).Result; + var chunk_response = _transporter.SendRequest<FileChunkDownloadRequest, FileChunkDownloadResponse>(chunk,new TransportRequestConfig() { Priority = QueuePriority.Low }).Result; if (chunk_response.Message.IsCanceled) { diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln index 4cc7b6153..36d90980f 100644 --- a/Software/Visual_Studio/Tango.sln +++ b/Software/Visual_Studio/Tango.sln @@ -383,6 +383,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Scripting.Core", "Scr EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.FSE.Stubs", "FSE\Modules\Tango.FSE.Stubs\Tango.FSE.Stubs.csproj", "{1754F846-4763-4000-807F-C7BFAA145DB2}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Scripting.Formatting", "Scripting\Tango.Scripting.Formatting\Tango.Scripting.Formatting.csproj", "{8D8F06ED-7F75-4933-B0C5-829B0FF654D0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.ColorPickers", "Tango.ColorPickers\Tango.ColorPickers.csproj", "{F9DF9435-A4F3-43C5-A6CD-AAD6689B42AE}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -3576,6 +3580,46 @@ Global {1754F846-4763-4000-807F-C7BFAA145DB2}.Release|x64.Build.0 = Release|Any CPU {1754F846-4763-4000-807F-C7BFAA145DB2}.Release|x86.ActiveCfg = Release|Any CPU {1754F846-4763-4000-807F-C7BFAA145DB2}.Release|x86.Build.0 = Release|Any CPU + {8D8F06ED-7F75-4933-B0C5-829B0FF654D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8D8F06ED-7F75-4933-B0C5-829B0FF654D0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8D8F06ED-7F75-4933-B0C5-829B0FF654D0}.Debug|ARM.ActiveCfg = Debug|Any CPU + {8D8F06ED-7F75-4933-B0C5-829B0FF654D0}.Debug|ARM.Build.0 = Debug|Any CPU + {8D8F06ED-7F75-4933-B0C5-829B0FF654D0}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {8D8F06ED-7F75-4933-B0C5-829B0FF654D0}.Debug|ARM64.Build.0 = Debug|Any CPU + {8D8F06ED-7F75-4933-B0C5-829B0FF654D0}.Debug|x64.ActiveCfg = Debug|Any CPU + {8D8F06ED-7F75-4933-B0C5-829B0FF654D0}.Debug|x64.Build.0 = Debug|Any CPU + {8D8F06ED-7F75-4933-B0C5-829B0FF654D0}.Debug|x86.ActiveCfg = Debug|Any CPU + {8D8F06ED-7F75-4933-B0C5-829B0FF654D0}.Debug|x86.Build.0 = Debug|Any CPU + {8D8F06ED-7F75-4933-B0C5-829B0FF654D0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8D8F06ED-7F75-4933-B0C5-829B0FF654D0}.Release|Any CPU.Build.0 = Release|Any CPU + {8D8F06ED-7F75-4933-B0C5-829B0FF654D0}.Release|ARM.ActiveCfg = Release|Any CPU + {8D8F06ED-7F75-4933-B0C5-829B0FF654D0}.Release|ARM.Build.0 = Release|Any CPU + {8D8F06ED-7F75-4933-B0C5-829B0FF654D0}.Release|ARM64.ActiveCfg = Release|Any CPU + {8D8F06ED-7F75-4933-B0C5-829B0FF654D0}.Release|ARM64.Build.0 = Release|Any CPU + {8D8F06ED-7F75-4933-B0C5-829B0FF654D0}.Release|x64.ActiveCfg = Release|Any CPU + {8D8F06ED-7F75-4933-B0C5-829B0FF654D0}.Release|x64.Build.0 = Release|Any CPU + {8D8F06ED-7F75-4933-B0C5-829B0FF654D0}.Release|x86.ActiveCfg = Release|Any CPU + {8D8F06ED-7F75-4933-B0C5-829B0FF654D0}.Release|x86.Build.0 = Release|Any CPU + {F9DF9435-A4F3-43C5-A6CD-AAD6689B42AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F9DF9435-A4F3-43C5-A6CD-AAD6689B42AE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F9DF9435-A4F3-43C5-A6CD-AAD6689B42AE}.Debug|ARM.ActiveCfg = Debug|Any CPU + {F9DF9435-A4F3-43C5-A6CD-AAD6689B42AE}.Debug|ARM.Build.0 = Debug|Any CPU + {F9DF9435-A4F3-43C5-A6CD-AAD6689B42AE}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {F9DF9435-A4F3-43C5-A6CD-AAD6689B42AE}.Debug|ARM64.Build.0 = Debug|Any CPU + {F9DF9435-A4F3-43C5-A6CD-AAD6689B42AE}.Debug|x64.ActiveCfg = Debug|Any CPU + {F9DF9435-A4F3-43C5-A6CD-AAD6689B42AE}.Debug|x64.Build.0 = Debug|Any CPU + {F9DF9435-A4F3-43C5-A6CD-AAD6689B42AE}.Debug|x86.ActiveCfg = Debug|Any CPU + {F9DF9435-A4F3-43C5-A6CD-AAD6689B42AE}.Debug|x86.Build.0 = Debug|Any CPU + {F9DF9435-A4F3-43C5-A6CD-AAD6689B42AE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F9DF9435-A4F3-43C5-A6CD-AAD6689B42AE}.Release|Any CPU.Build.0 = Release|Any CPU + {F9DF9435-A4F3-43C5-A6CD-AAD6689B42AE}.Release|ARM.ActiveCfg = Release|Any CPU + {F9DF9435-A4F3-43C5-A6CD-AAD6689B42AE}.Release|ARM.Build.0 = Release|Any CPU + {F9DF9435-A4F3-43C5-A6CD-AAD6689B42AE}.Release|ARM64.ActiveCfg = Release|Any CPU + {F9DF9435-A4F3-43C5-A6CD-AAD6689B42AE}.Release|ARM64.Build.0 = Release|Any CPU + {F9DF9435-A4F3-43C5-A6CD-AAD6689B42AE}.Release|x64.ActiveCfg = Release|Any CPU + {F9DF9435-A4F3-43C5-A6CD-AAD6689B42AE}.Release|x64.Build.0 = Release|Any CPU + {F9DF9435-A4F3-43C5-A6CD-AAD6689B42AE}.Release|x86.ActiveCfg = Release|Any CPU + {F9DF9435-A4F3-43C5-A6CD-AAD6689B42AE}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -3705,6 +3749,7 @@ Global {2B29A699-1D65-463A-8250-A2CE81D019C9} = {3D750293-C243-48F6-9112-A6B3FF650C0D} {5812E1C6-ABAA-4066-94AC-971C27B4F46A} = {3D750293-C243-48F6-9112-A6B3FF650C0D} {1754F846-4763-4000-807F-C7BFAA145DB2} = {4EE6DBA1-71BC-49E2-8DC7-266487E61050} + {8D8F06ED-7F75-4933-B0C5-829B0FF654D0} = {3D750293-C243-48F6-9112-A6B3FF650C0D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7986F7F4-A86A-4994-B1B6-0988D7F057B6} diff --git a/Software/Visual_Studio/Utilities/Tango.DispenserAnalyzer.UI/Analyzers/FlowAnalyser.cs b/Software/Visual_Studio/Utilities/Tango.DispenserAnalyzer.UI/Analyzers/FlowAnalyser.cs index a9c20182e..8e019170e 100644 --- a/Software/Visual_Studio/Utilities/Tango.DispenserAnalyzer.UI/Analyzers/FlowAnalyser.cs +++ b/Software/Visual_Studio/Utilities/Tango.DispenserAnalyzer.UI/Analyzers/FlowAnalyser.cs @@ -176,7 +176,7 @@ namespace Tango.DispenserAnalyzer.UI.Analyzers private double BuildMeasurementError(List<int> range_values) { int count = range_values.Count(); - return (count - (count * 0.98)); + return (count - (count * 0.99)); } /// <summary> @@ -203,7 +203,9 @@ namespace Tango.DispenserAnalyzer.UI.Analyzers break; } } - Result = (range <= 25 && range >= 20) ? AnalyzerResultValue.Passed : AnalyzerResultValue.Failed; + //Result = (range <= 25 && range >= 20) ? AnalyzerResultValue.Passed : AnalyzerResultValue.Failed; + var res = range / AverageValue * 100; + Result = res < 1.3 ? AnalyzerResultValue.Passed : AnalyzerResultValue.Failed; return max_key; } } diff --git a/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml b/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml index 13e741d8e..c4462d736 100644 --- a/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml +++ b/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml @@ -4,16 +4,18 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:colorpic="clr-namespace:Tango.ColorPickers;assembly=Tango.ColorPickers" mc:Ignorable="d" Title="MainWindow" Height="700" Width="800" DataContext="{Binding RelativeSource={RelativeSource Self}}" > <Grid> <Border> - <controls:MultiSelectComboBox Width="250" Height="60" Background="White" Foreground="Black" + <!--<controls:MultiSelectComboBox Width="250" Height="60" Background="White" Foreground="Black" x:Name="MSCombobox" BorderBrush="Gainsboro" BorderThickness="0.8" Items="{Binding Items}" - SelectedItemsList ="{Binding SelectedItems}"/> + SelectedItemsList ="{Binding SelectedItems}"/>--> + <colorpic:ColorPickerControl Width="300" Height="80" Background="White" Foreground="Black" BorderBrush="LightGray" BorderThickness="0.8"/> </Border> </Grid> </Window> diff --git a/Software/Visual_Studio/Utilities/Tango.UITests/Tango.UITests.csproj b/Software/Visual_Studio/Utilities/Tango.UITests/Tango.UITests.csproj index 9ac2e3105..cd5aaf983 100644 --- a/Software/Visual_Studio/Utilities/Tango.UITests/Tango.UITests.csproj +++ b/Software/Visual_Studio/Utilities/Tango.UITests/Tango.UITests.csproj @@ -144,6 +144,10 @@ <Project>{F441FEEE-322A-4943-B566-110E12FD3B72}</Project> <Name>Tango.BL</Name> </ProjectReference> + <ProjectReference Include="..\..\Tango.ColorPickers\Tango.ColorPickers.csproj"> + <Project>{f9df9435-a4f3-43c5-a6cd-aad6689b42ae}</Project> + <Name>Tango.ColorPickers</Name> + </ProjectReference> <ProjectReference Include="..\..\Tango.Core\Tango.Core.csproj"> <Project>{A34EE0F0-649D-41C8-8489-B6F1CC6924EE}</Project> <Name>Tango.Core</Name> @@ -184,7 +188,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file |
