From e2f848996a5a8e8c1eb57b490bb0660b4654b44e Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Thu, 4 Jun 2020 14:40:26 +0300 Subject: Added tooltips for liquid quantity in the statistics module of Machine Studio. Related Work Items: #2937 --- .../LiquidQuantityToFormatStringConverter.cs | 35 ++++++++++ .../Converters/NanoLiterToLiterFormatConverter.cs | 7 +- .../Tango.MachineStudio.Statistics.csproj | 1 + .../Views/JobRunsView.xaml | 18 +++-- .../Tango.SimulateTouch.UI/MainWindow.xaml.cs | 76 ---------------------- 5 files changed, 54 insertions(+), 83 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Converters/LiquidQuantityToFormatStringConverter.cs (limited to 'Software') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Converters/LiquidQuantityToFormatStringConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Converters/LiquidQuantityToFormatStringConverter.cs new file mode 100644 index 000000000..e5f06e167 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Converters/LiquidQuantityToFormatStringConverter.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + + +namespace Tango.MachineStudio.Statistics.Converters +{ + public class LiquidQuantityToFormatStringConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + try + { + var longValue = System.Convert.ToUInt64(value.ToString()); + double liters_val = (longValue / 1000000000d); + double cc_val = (longValue / 1000000d); + double dispensers_val = (longValue / 130000000d); + string tooltip = String.Format($"Nanoliters: {longValue}\nCubic Centimeters: {cc_val}\nLiters: {liters_val}\nDispensers: {dispensers_val}"); + return tooltip; + } + catch { } + + return ""; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Converters/NanoLiterToLiterFormatConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Converters/NanoLiterToLiterFormatConverter.cs index 32050cdb1..97f4ec066 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Converters/NanoLiterToLiterFormatConverter.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Converters/NanoLiterToLiterFormatConverter.cs @@ -16,7 +16,12 @@ namespace Tango.MachineStudio.Statistics.Converters { var longValue = System.Convert.ToUInt64(value.ToString()); double val = (longValue / 1000000000d); - return val.ToString("0.0"); + if (parameter is string) + { + string format= (string)parameter; + return val.ToString(format); + } + return val.ToString(); } catch { } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Tango.MachineStudio.Statistics.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Tango.MachineStudio.Statistics.csproj index e484754bc..02e3f40a9 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Tango.MachineStudio.Statistics.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Tango.MachineStudio.Statistics.csproj @@ -79,6 +79,7 @@ + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/JobRunsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/JobRunsView.xaml index 4ce6030d9..2e6770d9e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/JobRunsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/JobRunsView.xaml @@ -31,6 +31,7 @@ + + @@ -692,7 +694,8 @@ - + + @@ -701,17 +704,19 @@ - + + + - + + diff --git a/Software/Visual_Studio/Tango.SimulateTouch.UI/MainWindow.xaml.cs b/Software/Visual_Studio/Tango.SimulateTouch.UI/MainWindow.xaml.cs index 33181b13d..be5c61e6e 100644 --- a/Software/Visual_Studio/Tango.SimulateTouch.UI/MainWindow.xaml.cs +++ b/Software/Visual_Studio/Tango.SimulateTouch.UI/MainWindow.xaml.cs @@ -23,7 +23,6 @@ namespace Tango.SimulateTouch.UI /// public partial class MainWindow : Window { - //Windows.UI.Input.Preview.Injection.InputInjector _inputInjector; private Line ProxyLine; public MainWindow() @@ -70,82 +69,7 @@ namespace Tango.SimulateTouch.UI // HwndSource source = (HwndSource)HwndSource.FromVisual(messageTextBlock); // IntPtr hWnd = source.Handle; Console.WriteLine("OnButtonLeftButtonDown"); - TouchSimulate ts = new TouchSimulate(); - - //TEST UWP - error COM!!!! - /* _inputInjector = InputInjector.TryCreate(); - if (_inputInjector != null) - { - _inputInjector.InitializeTouchInjection( InjectedInputVisualizationMode.Default); - uint pointerId = 1; - var appBounds = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().VisibleBounds; - Point appBoundsTopLeft = new Point(appBounds.Left, appBounds.Top); - Point targetLoc = messageTextBlock.PointToScreen(new Point(0, 0)); - - // Get the screen coordinates (relative to the input area) - // of the input pointer. - Point screenPointPosition = button.PointToScreen(coordinates); - int pointerPointX = (int)screenPointPosition.X; - int pointerPointY = (int)screenPointPosition.Y; - - // Create the point for input injection and calculate its screen location. - Point injectionPoint = - new Point( - appBoundsTopLeft.X + targetLoc.X + pointerPointX, - appBoundsTopLeft.Y + targetLoc.Y + pointerPointY); - - // Create a touch data point for pointer down. - // Each element in the touch data list represents a single touch contact. - // For this example, we're mirroring a single mouse pointer. - List touchData = new List - { - new InjectedInputTouchInfo - { - Contact = new InjectedInputRectangle - { - Left = 30, Top = 30, Bottom = 30, Right = 30 - }, - PointerInfo = new InjectedInputPointerInfo - { - PointerId = pointerId, - PointerOptions = - InjectedInputPointerOptions.PointerDown | - InjectedInputPointerOptions.InContact | - InjectedInputPointerOptions.New, - TimeOffsetInMilliseconds = 0, - PixelLocation = new InjectedInputPoint - { - PositionX = (int)injectionPoint.X , - PositionY = (int)injectionPoint.Y - } - }, - Pressure = 1.0, - TouchParameters = - InjectedInputTouchParameters.Pressure | - InjectedInputTouchParameters.Contact - } - }; - - // Inject the touch input. - _inputInjector.InjectTouchInput(touchData); - - // Create a touch data point for pointer up. - touchData = new List - { - new InjectedInputTouchInfo - { - PointerInfo = new InjectedInputPointerInfo - { - PointerId = pointerId, - PointerOptions = InjectedInputPointerOptions.PointerUp - } - } - }; - - // Inject the touch input. - _inputInjector.InjectTouchInput(touchData); - }*/ } } } -- cgit v1.3.1 From 46f46d91c521e66c203b31110a21b94024b2166d Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 4 Jun 2020 17:09:17 +0300 Subject: stubs and logs, need cleaning --- .../Embedded/Common/SWUpdate/FirmwareUpgrade.c | 5 + .../Embedded/Communication/CommunicationTask.c | 2 +- .../Embedded_SW/Embedded/Communication/Container.c | 8 + .../Communication/PMR/Common/MessageType.pb-c.c | 254 +++++++++++---------- .../Communication/PMR/Common/MessageType.pb-c.h | 4 + .../PMR/Stubs/StubMainCardEEpromReadRequest.pb-c.c | 105 +++++++++ .../PMR/Stubs/StubMainCardEEpromReadRequest.pb-c.h | 74 ++++++ .../Stubs/StubMainCardEEpromReadResponse.pb-c.c | 105 +++++++++ .../Stubs/StubMainCardEEpromReadResponse.pb-c.h | 74 ++++++ .../Stubs/StubMainCardEEpromWriteRequest.pb-c.c | 105 +++++++++ .../Stubs/StubMainCardEEpromWriteRequest.pb-c.h | 74 ++++++ .../Stubs/StubMainCardEEpromWriteResponse.pb-c.c | 72 ++++++ .../Stubs/StubMainCardEEpromWriteResponse.pb-c.h | 70 ++++++ .../Embedded/Drivers/FPGA/FPGA_SPI_Comm.c | 1 + .../Dispenser_Card/EEPROM/Dispenser_EEPROM.c | 2 +- .../Embedded/Drivers/flash_ram/MCU_E2Prom.c | 84 +++++++ .../Embedded/Drivers/flash_ram/MCU_E2Prom.h | 3 + .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 2 +- .../Embedded/Modules/General/GeneralHardware.c | 25 +- .../Embedded/Modules/Heaters/Heaters_ex.h | 1 + .../Embedded/Modules/Heaters/Heaters_print.c | 23 +- .../Embedded/Modules/Stubs_Handler/Progress.c | 8 + .../Embedded/Modules/Thread/ThreadLoad.c | 32 ++- .../Embedded/Modules/Thread/Thread_print.c | 2 +- .../Embedded/StateMachines/Printing/JobSTM.c | 23 +- .../Embedded/StateMachines/Printing/PrintingSTM.c | 14 +- .../Embedded/StateMachines/Printing/PrintingSTM.h | 2 + Software/PMR/Messages/Common/MessageType.proto | 4 + .../Stubs/StubMainCardEEpromReadRequest.proto | 11 + .../Stubs/StubMainCardEEpromReadResponse.proto | 11 + .../Stubs/StubMainCardEEpromWriteRequest.proto | 11 + .../Stubs/StubMainCardEEpromWriteResponse.proto | 10 + 32 files changed, 1055 insertions(+), 166 deletions(-) create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromReadRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromReadRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromReadResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromReadResponse.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteResponse.pb-c.h create mode 100644 Software/PMR/Messages/Stubs/StubMainCardEEpromReadRequest.proto create mode 100644 Software/PMR/Messages/Stubs/StubMainCardEEpromReadResponse.proto create mode 100644 Software/PMR/Messages/Stubs/StubMainCardEEpromWriteRequest.proto create mode 100644 Software/PMR/Messages/Stubs/StubMainCardEEpromWriteResponse.proto (limited to 'Software') diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c index 7f57083fc..d6e391e87 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c @@ -160,6 +160,7 @@ uint32_t ActivateVersionRequestFunc(MessageContainer* requestContainer) Fresult = f_unlink("//SYSINFO//EMBPARAM.CFG"); Fresult |= f_rename (FullPath, "//SYSINFO//EMBPARAM.CFG"); LoadConfigurationParamsFromFile(true); + Report("ConfigParams",__FILE__,Fresult,(int)NumberOfFiles,RpWarning,CurrentRunningFile,0); CurrentRunningFile++; break; case VERSION_FILE_DESTINATION__ProcessParams: @@ -167,12 +168,14 @@ uint32_t ActivateVersionRequestFunc(MessageContainer* requestContainer) Fresult = f_unlink("//SYSINFO//PROCESSP.CFG"); Fresult |= f_rename (FullPath, "//SYSINFO//PROCESSP.CFG"); LoadProcessParamsFromFile(); + Report("ProcessParams",__FILE__,Fresult,(int)NumberOfFiles,RpWarning,CurrentRunningFile,0); CurrentRunningFile++; break; case VERSION_FILE_DESTINATION__AlarmParams: usnprintf(FullPath, 50, "%s%s%s", request->path,"/", VersionPackage->filedescriptors[File_i]->filename); Fresult = f_unlink("//SYSINFO//ALARM.CFG"); Fresult |= f_rename (FullPath, "//SYSINFO//ALARM.CFG"); + Report("AlarmParams",__FILE__,Fresult,(int)NumberOfFiles,RpWarning,CurrentRunningFile,0); //AlarmHandlingLoadFile(); FlashInit(); Reboot = true; @@ -182,6 +185,7 @@ uint32_t ActivateVersionRequestFunc(MessageContainer* requestContainer) usnprintf(FullPath, 50, "%s%s%s", request->path,"/", VersionPackage->filedescriptors[File_i]->filename); Fresult = f_unlink("//SYSINFO//GENHWCFG.CFG"); Fresult |= f_rename (FullPath, "//SYSINFO//GENHWCFG.CFG"); + Report("GeneralHWConfigParams",__FILE__,Fresult,(int)NumberOfFiles,RpWarning,CurrentRunningFile,0); HWConfigurationLoadFile(); CurrentRunningFile++; break; @@ -201,6 +205,7 @@ uint32_t ActivateVersionRequestFunc(MessageContainer* requestContainer) responseContainer.error = FileError_to_ErrorCode[Fresult]; responseContainer.errormessage = "Activate Version Request error"; responseContainer.continuous = false; + Report("Activate Version Request error",__FILE__,__LINE__,(int)NumberOfFiles,RpWarning,Fresult,0); } uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); size_t container_size = message_container__pack(&responseContainer, container_buffer); diff --git a/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c b/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c index 0efb698f7..c846ae0a3 100644 --- a/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c +++ b/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c @@ -127,7 +127,7 @@ void freeArray(uint32_t buffer) uint32_t CommunicationTaskInit(void) { USBCDCD_init(); - //Init_U0(); + Init_U0(); return OK; } diff --git a/Software/Embedded_SW/Embedded/Communication/Container.c b/Software/Embedded_SW/Embedded/Communication/Container.c index dec940191..1bdc0b535 100644 --- a/Software/Embedded_SW/Embedded/Communication/Container.c +++ b/Software/Embedded_SW/Embedded/Communication/Container.c @@ -47,6 +47,8 @@ #include "Common/SWUpdate/FirmwareUpgrade.h" #include "Communication/CommunicationTask.h" +#include "drivers/Flash_ram/MCU_E2Prom.h" + #include "StateMachines/Printing/PrintingSTM.h" #include "StateMachines/Initialization/PowerIdle.h" #include "StateMachines/Initialization/PowerOffSequence.h" @@ -498,6 +500,12 @@ void receive_callback(char* buffer, size_t length) case MESSAGE_TYPE__StubWhsEEpromRequest: WhsEEpromRequestFunc(requestContainer); break; + case MESSAGE_TYPE__StubMainCardEEpromReadRequest: + MainCardEEpromReadRequestFunc(requestContainer); + break; + case MESSAGE_TYPE__StubMainCardEEpromWriteRequest: + MainCardEEpromWriteRequestFunc(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 000774ad7..2c7d12003 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[253] = +static const ProtobufCEnumValue message_type__enum_values_by_number[257] = { { "", "", 0 }, { "", "", 1 }, @@ -117,6 +117,10 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[253] = { "", "", 106 }, { "", "", 107 }, { "", "", 108 }, + { "", "", 109 }, + { "", "", 110 }, + { "", "", 111 }, + { "", "", 112 }, { "", "", 1000 }, { "", "", 1001 }, { "", "", 1002 }, @@ -264,147 +268,147 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[253] = { "", "", 11005 }, }; static const ProtobufCIntRange message_type__value_ranges[] = { -{0, 0},{3, 2},{1000, 108},{2000, 127},{3000, 173},{4000, 187},{5000, 195},{6000, 199},{7000, 205},{8000, 229},{9000, 235},{10000, 239},{11000, 247},{0, 253} +{0, 0},{3, 2},{1000, 112},{2000, 131},{3000, 177},{4000, 191},{5000, 199},{6000, 203},{7000, 209},{8000, 233},{9000, 239},{10000, 243},{11000, 251},{0, 257} }; -static const ProtobufCEnumValueIndex message_type__enum_values_by_name[253] = +static const ProtobufCEnumValueIndex message_type__enum_values_by_name[257] = { - { "", 185 }, - { "", 186 }, - { "", 175 }, - { "", 176 }, - { "", 241 }, - { "", 242 }, + { "", 189 }, + { "", 190 }, + { "", 179 }, + { "", 180 }, { "", 245 }, { "", 246 }, - { "", 227 }, - { "", 228 }, - { "", 2 }, - { "", 3 }, - { "", 171 }, - { "", 172 }, - { "", 121 }, - { "", 122 }, - { "", 201 }, - { "", 202 }, { "", 249 }, { "", 250 }, + { "", 231 }, + { "", 232 }, + { "", 2 }, + { "", 3 }, + { "", 175 }, + { "", 176 }, + { "", 125 }, + { "", 126 }, + { "", 205 }, + { "", 206 }, + { "", 253 }, + { "", 254 }, + { "", 217 }, + { "", 218 }, + { "", 183 }, + { "", 184 }, + { "", 219 }, + { "", 220 }, + { "", 117 }, + { "", 118 }, + { "", 207 }, + { "", 208 }, + { "", 141 }, + { "", 142 }, + { "", 147 }, + { "", 148 }, + { "", 233 }, + { "", 234 }, + { "", 143 }, + { "", 144 }, + { "", 145 }, + { "", 146 }, + { "", 1 }, { "", 213 }, { "", 214 }, - { "", 179 }, - { "", 180 }, - { "", 215 }, - { "", 216 }, { "", 113 }, { "", 114 }, - { "", 203 }, - { "", 204 }, - { "", 137 }, - { "", 138 }, - { "", 143 }, - { "", 144 }, - { "", 229 }, - { "", 230 }, - { "", 139 }, - { "", 140 }, - { "", 141 }, - { "", 142 }, - { "", 1 }, + { "", 115 }, + { "", 116 }, + { "", 112 }, + { "", 227 }, + { "", 228 }, + { "", 211 }, + { "", 212 }, + { "", 225 }, + { "", 226 }, { "", 209 }, { "", 210 }, - { "", 109 }, - { "", 110 }, - { "", 111 }, - { "", 112 }, - { "", 108 }, + { "", 129 }, + { "", 130 }, { "", 223 }, { "", 224 }, - { "", 207 }, - { "", 208 }, { "", 221 }, { "", 222 }, - { "", 205 }, - { "", 206 }, - { "", 125 }, - { "", 126 }, - { "", 219 }, - { "", 220 }, - { "", 217 }, - { "", 218 }, - { "", 173 }, - { "", 174 }, - { "", 199 }, - { "", 200 }, - { "", 211 }, - { "", 212 }, - { "", 233 }, - { "", 234 }, - { "", 231 }, - { "", 232 }, - { "", 129 }, - { "", 130 }, - { "", 135 }, - { "", 136 }, - { "", 131 }, - { "", 132 }, + { "", 177 }, + { "", 178 }, + { "", 203 }, + { "", 204 }, + { "", 215 }, + { "", 216 }, + { "", 237 }, + { "", 238 }, + { "", 235 }, + { "", 236 }, { "", 133 }, { "", 134 }, + { "", 139 }, + { "", 140 }, + { "", 135 }, + { "", 136 }, + { "", 137 }, + { "", 138 }, { "", 0 }, - { "", 115 }, - { "", 116 }, + { "", 119 }, + { "", 120 }, { "", 4 }, { "", 5 }, - { "", 153 }, - { "", 154 }, - { "", 181 }, - { "", 182 }, - { "", 163 }, - { "", 164 }, - { "", 151 }, - { "", 152 }, + { "", 157 }, + { "", 158 }, + { "", 185 }, + { "", 186 }, + { "", 167 }, + { "", 168 }, + { "", 155 }, + { "", 156 }, + { "", 195 }, + { "", 196 }, + { "", 149 }, + { "", 150 }, + { "", 165 }, + { "", 166 }, + { "", 169 }, + { "", 170 }, + { "", 197 }, + { "", 198 }, + { "", 121 }, + { "", 122 }, + { "", 171 }, + { "", 172 }, { "", 191 }, { "", 192 }, - { "", 145 }, - { "", 146 }, + { "", 131 }, + { "", 132 }, { "", 161 }, { "", 162 }, - { "", 165 }, - { "", 166 }, - { "", 193 }, - { "", 194 }, - { "", 117 }, - { "", 118 }, - { "", 167 }, - { "", 168 }, { "", 187 }, { "", 188 }, - { "", 127 }, - { "", 128 }, - { "", 157 }, - { "", 158 }, - { "", 183 }, - { "", 184 }, - { "", 235 }, - { "", 236 }, { "", 239 }, { "", 240 }, { "", 243 }, { "", 244 }, { "", 247 }, { "", 248 }, - { "", 119 }, - { "", 120 }, - { "", 169 }, - { "", 170 }, - { "", 189 }, - { "", 190 }, - { "", 155 }, - { "", 156 }, - { "", 159 }, - { "", 160 }, - { "", 237 }, - { "", 238 }, { "", 251 }, { "", 252 }, + { "", 123 }, + { "", 124 }, + { "", 173 }, + { "", 174 }, + { "", 193 }, + { "", 194 }, + { "", 159 }, + { "", 160 }, + { "", 163 }, + { "", 164 }, + { "", 241 }, + { "", 242 }, + { "", 255 }, + { "", 256 }, { "", 100 }, { "", 101 }, { "", 6 }, @@ -465,6 +469,10 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[253] = { "", 99 }, { "", 40 }, { "", 41 }, + { "", 108 }, + { "", 109 }, + { "", 110 }, + { "", 111 }, { "", 102 }, { "", 103 }, { "", 66 }, @@ -507,20 +515,20 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[253] = { "", 31 }, { "", 106 }, { "", 107 }, - { "", 197 }, - { "", 198 }, - { "", 149 }, - { "", 150 }, - { "", 147 }, - { "", 148 }, - { "", 123 }, - { "", 124 }, - { "", 195 }, - { "", 196 }, - { "", 177 }, - { "", 178 }, - { "", 225 }, - { "", 226 }, + { "", 201 }, + { "", 202 }, + { "", 153 }, + { "", 154 }, + { "", 151 }, + { "", 152 }, + { "", 127 }, + { "", 128 }, + { "", 199 }, + { "", 200 }, + { "", 181 }, + { "", 182 }, + { "", 229 }, + { "", 230 }, }; const ProtobufCEnumDescriptor message_type__descriptor = { @@ -529,9 +537,9 @@ const ProtobufCEnumDescriptor message_type__descriptor = "", "", "", - 253, + 257, message_type__enum_values_by_number, - 253, + 257, 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 14b49cd6c..3cfe8f4fb 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 @@ -128,6 +128,10 @@ typedef enum _MessageType { MESSAGE_TYPE__StubDispenserEEpromResponse = 106, MESSAGE_TYPE__StubWhsEEpromRequest = 107, MESSAGE_TYPE__StubWhsEEpromResponse = 108, + MESSAGE_TYPE__StubMainCardEEpromReadRequest = 109, + MESSAGE_TYPE__StubMainCardEEpromReadResponse = 110, + MESSAGE_TYPE__StubMainCardEEpromWriteRequest = 111, + MESSAGE_TYPE__StubMainCardEEpromWriteResponse = 112, MESSAGE_TYPE__ExternalBridgeUdpDiscoveryPacket = 1000, MESSAGE_TYPE__ExternalBridgeLoginRequest = 1001, MESSAGE_TYPE__ExternalBridgeLoginResponse = 1002, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromReadRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromReadRequest.pb-c.c new file mode 100644 index 000000000..86a08272b --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromReadRequest.pb-c.c @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMainCardEEpromReadRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubMainCardEEpromReadRequest.pb-c.h" +void stub_main_card_eeprom_read_request__init + (StubMainCardEEpromReadRequest *message) +{ + static const StubMainCardEEpromReadRequest init_value = STUB_MAIN_CARD_EEPROM_READ_REQUEST__INIT; + *message = init_value; +} +size_t stub_main_card_eeprom_read_request__get_packed_size + (const StubMainCardEEpromReadRequest *message) +{ + assert(message->base.descriptor == &stub_main_card_eeprom_read_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_main_card_eeprom_read_request__pack + (const StubMainCardEEpromReadRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_main_card_eeprom_read_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_main_card_eeprom_read_request__pack_to_buffer + (const StubMainCardEEpromReadRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_main_card_eeprom_read_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubMainCardEEpromReadRequest * + stub_main_card_eeprom_read_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubMainCardEEpromReadRequest *) + protobuf_c_message_unpack (&stub_main_card_eeprom_read_request__descriptor, + allocator, len, data); +} +void stub_main_card_eeprom_read_request__free_unpacked + (StubMainCardEEpromReadRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_main_card_eeprom_read_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_main_card_eeprom_read_request__field_descriptors[2] = +{ + { + "", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(StubMainCardEEpromReadRequest, has_address), + offsetof(StubMainCardEEpromReadRequest, address), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(StubMainCardEEpromReadRequest, has_data), + offsetof(StubMainCardEEpromReadRequest, data), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_main_card_eeprom_read_request__field_indices_by_name[] = { + 0, /* field[0] = Address */ + 1, /* field[1] = Data */ +}; +static const ProtobufCIntRange stub_main_card_eeprom_read_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor stub_main_card_eeprom_read_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(StubMainCardEEpromReadRequest), + 2, + stub_main_card_eeprom_read_request__field_descriptors, + stub_main_card_eeprom_read_request__field_indices_by_name, + 1, stub_main_card_eeprom_read_request__number_ranges, + (ProtobufCMessageInit) stub_main_card_eeprom_read_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromReadRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromReadRequest.pb-c.h new file mode 100644 index 000000000..25416bead --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromReadRequest.pb-c.h @@ -0,0 +1,74 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMainCardEEpromReadRequest.proto */ + +#ifndef PROTOBUF_C_StubMainCardEEpromReadRequest_2eproto__INCLUDED +#define PROTOBUF_C_StubMainCardEEpromReadRequest_2eproto__INCLUDED + +#include + +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 _StubMainCardEEpromReadRequest StubMainCardEEpromReadRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubMainCardEEpromReadRequest +{ + ProtobufCMessage base; + protobuf_c_boolean has_address; + int32_t address; + protobuf_c_boolean has_data; + int32_t data; +}; +#define STUB_MAIN_CARD_EEPROM_READ_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_main_card_eeprom_read_request__descriptor) \ + , 0, 0, 0, 0 } + + +/* StubMainCardEEpromReadRequest methods */ +void stub_main_card_eeprom_read_request__init + (StubMainCardEEpromReadRequest *message); +size_t stub_main_card_eeprom_read_request__get_packed_size + (const StubMainCardEEpromReadRequest *message); +size_t stub_main_card_eeprom_read_request__pack + (const StubMainCardEEpromReadRequest *message, + uint8_t *out); +size_t stub_main_card_eeprom_read_request__pack_to_buffer + (const StubMainCardEEpromReadRequest *message, + ProtobufCBuffer *buffer); +StubMainCardEEpromReadRequest * + stub_main_card_eeprom_read_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_main_card_eeprom_read_request__free_unpacked + (StubMainCardEEpromReadRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubMainCardEEpromReadRequest_Closure) + (const StubMainCardEEpromReadRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_main_card_eeprom_read_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubMainCardEEpromReadRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromReadResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromReadResponse.pb-c.c new file mode 100644 index 000000000..0cddbe8c8 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromReadResponse.pb-c.c @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMainCardEEpromReadResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubMainCardEEpromReadResponse.pb-c.h" +void stub_main_card_eeprom_read_response__init + (StubMainCardEEpromReadResponse *message) +{ + static const StubMainCardEEpromReadResponse init_value = STUB_MAIN_CARD_EEPROM_READ_RESPONSE__INIT; + *message = init_value; +} +size_t stub_main_card_eeprom_read_response__get_packed_size + (const StubMainCardEEpromReadResponse *message) +{ + assert(message->base.descriptor == &stub_main_card_eeprom_read_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_main_card_eeprom_read_response__pack + (const StubMainCardEEpromReadResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_main_card_eeprom_read_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_main_card_eeprom_read_response__pack_to_buffer + (const StubMainCardEEpromReadResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_main_card_eeprom_read_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubMainCardEEpromReadResponse * + stub_main_card_eeprom_read_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubMainCardEEpromReadResponse *) + protobuf_c_message_unpack (&stub_main_card_eeprom_read_response__descriptor, + allocator, len, data); +} +void stub_main_card_eeprom_read_response__free_unpacked + (StubMainCardEEpromReadResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_main_card_eeprom_read_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_main_card_eeprom_read_response__field_descriptors[2] = +{ + { + "", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(StubMainCardEEpromReadResponse, has_address), + offsetof(StubMainCardEEpromReadResponse, address), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(StubMainCardEEpromReadResponse, has_data), + offsetof(StubMainCardEEpromReadResponse, data), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_main_card_eeprom_read_response__field_indices_by_name[] = { + 0, /* field[0] = Address */ + 1, /* field[1] = Data */ +}; +static const ProtobufCIntRange stub_main_card_eeprom_read_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor stub_main_card_eeprom_read_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(StubMainCardEEpromReadResponse), + 2, + stub_main_card_eeprom_read_response__field_descriptors, + stub_main_card_eeprom_read_response__field_indices_by_name, + 1, stub_main_card_eeprom_read_response__number_ranges, + (ProtobufCMessageInit) stub_main_card_eeprom_read_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromReadResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromReadResponse.pb-c.h new file mode 100644 index 000000000..48f6f7502 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromReadResponse.pb-c.h @@ -0,0 +1,74 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMainCardEEpromReadResponse.proto */ + +#ifndef PROTOBUF_C_StubMainCardEEpromReadResponse_2eproto__INCLUDED +#define PROTOBUF_C_StubMainCardEEpromReadResponse_2eproto__INCLUDED + +#include + +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 _StubMainCardEEpromReadResponse StubMainCardEEpromReadResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubMainCardEEpromReadResponse +{ + ProtobufCMessage base; + protobuf_c_boolean has_address; + int32_t address; + protobuf_c_boolean has_data; + int32_t data; +}; +#define STUB_MAIN_CARD_EEPROM_READ_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_main_card_eeprom_read_response__descriptor) \ + , 0, 0, 0, 0 } + + +/* StubMainCardEEpromReadResponse methods */ +void stub_main_card_eeprom_read_response__init + (StubMainCardEEpromReadResponse *message); +size_t stub_main_card_eeprom_read_response__get_packed_size + (const StubMainCardEEpromReadResponse *message); +size_t stub_main_card_eeprom_read_response__pack + (const StubMainCardEEpromReadResponse *message, + uint8_t *out); +size_t stub_main_card_eeprom_read_response__pack_to_buffer + (const StubMainCardEEpromReadResponse *message, + ProtobufCBuffer *buffer); +StubMainCardEEpromReadResponse * + stub_main_card_eeprom_read_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_main_card_eeprom_read_response__free_unpacked + (StubMainCardEEpromReadResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubMainCardEEpromReadResponse_Closure) + (const StubMainCardEEpromReadResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_main_card_eeprom_read_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubMainCardEEpromReadResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteRequest.pb-c.c new file mode 100644 index 000000000..0e4079608 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteRequest.pb-c.c @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMainCardEEpromWriteRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubMainCardEEpromWriteRequest.pb-c.h" +void stub_main_card_eeprom_write_request__init + (StubMainCardEEpromWriteRequest *message) +{ + static const StubMainCardEEpromWriteRequest init_value = STUB_MAIN_CARD_EEPROM_WRITE_REQUEST__INIT; + *message = init_value; +} +size_t stub_main_card_eeprom_write_request__get_packed_size + (const StubMainCardEEpromWriteRequest *message) +{ + assert(message->base.descriptor == &stub_main_card_eeprom_write_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_main_card_eeprom_write_request__pack + (const StubMainCardEEpromWriteRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_main_card_eeprom_write_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_main_card_eeprom_write_request__pack_to_buffer + (const StubMainCardEEpromWriteRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_main_card_eeprom_write_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubMainCardEEpromWriteRequest * + stub_main_card_eeprom_write_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubMainCardEEpromWriteRequest *) + protobuf_c_message_unpack (&stub_main_card_eeprom_write_request__descriptor, + allocator, len, data); +} +void stub_main_card_eeprom_write_request__free_unpacked + (StubMainCardEEpromWriteRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_main_card_eeprom_write_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_main_card_eeprom_write_request__field_descriptors[2] = +{ + { + "", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(StubMainCardEEpromWriteRequest, has_address), + offsetof(StubMainCardEEpromWriteRequest, address), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(StubMainCardEEpromWriteRequest, has_data), + offsetof(StubMainCardEEpromWriteRequest, data), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_main_card_eeprom_write_request__field_indices_by_name[] = { + 0, /* field[0] = Address */ + 1, /* field[1] = Data */ +}; +static const ProtobufCIntRange stub_main_card_eeprom_write_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor stub_main_card_eeprom_write_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(StubMainCardEEpromWriteRequest), + 2, + stub_main_card_eeprom_write_request__field_descriptors, + stub_main_card_eeprom_write_request__field_indices_by_name, + 1, stub_main_card_eeprom_write_request__number_ranges, + (ProtobufCMessageInit) stub_main_card_eeprom_write_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteRequest.pb-c.h new file mode 100644 index 000000000..f326c795a --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteRequest.pb-c.h @@ -0,0 +1,74 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMainCardEEpromWriteRequest.proto */ + +#ifndef PROTOBUF_C_StubMainCardEEpromWriteRequest_2eproto__INCLUDED +#define PROTOBUF_C_StubMainCardEEpromWriteRequest_2eproto__INCLUDED + +#include + +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 _StubMainCardEEpromWriteRequest StubMainCardEEpromWriteRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubMainCardEEpromWriteRequest +{ + ProtobufCMessage base; + protobuf_c_boolean has_address; + int32_t address; + protobuf_c_boolean has_data; + int32_t data; +}; +#define STUB_MAIN_CARD_EEPROM_WRITE_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_main_card_eeprom_write_request__descriptor) \ + , 0, 0, 0, 0 } + + +/* StubMainCardEEpromWriteRequest methods */ +void stub_main_card_eeprom_write_request__init + (StubMainCardEEpromWriteRequest *message); +size_t stub_main_card_eeprom_write_request__get_packed_size + (const StubMainCardEEpromWriteRequest *message); +size_t stub_main_card_eeprom_write_request__pack + (const StubMainCardEEpromWriteRequest *message, + uint8_t *out); +size_t stub_main_card_eeprom_write_request__pack_to_buffer + (const StubMainCardEEpromWriteRequest *message, + ProtobufCBuffer *buffer); +StubMainCardEEpromWriteRequest * + stub_main_card_eeprom_write_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_main_card_eeprom_write_request__free_unpacked + (StubMainCardEEpromWriteRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubMainCardEEpromWriteRequest_Closure) + (const StubMainCardEEpromWriteRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_main_card_eeprom_write_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubMainCardEEpromWriteRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteResponse.pb-c.c new file mode 100644 index 000000000..4d2e53d4c --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteResponse.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMainCardEEpromWriteResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubMainCardEEpromWriteResponse.pb-c.h" +void stub_main_card_eeprom_write_response__init + (StubMainCardEEpromWriteResponse *message) +{ + static const StubMainCardEEpromWriteResponse init_value = STUB_MAIN_CARD_EEPROM_WRITE_RESPONSE__INIT; + *message = init_value; +} +size_t stub_main_card_eeprom_write_response__get_packed_size + (const StubMainCardEEpromWriteResponse *message) +{ + assert(message->base.descriptor == &stub_main_card_eeprom_write_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_main_card_eeprom_write_response__pack + (const StubMainCardEEpromWriteResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_main_card_eeprom_write_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_main_card_eeprom_write_response__pack_to_buffer + (const StubMainCardEEpromWriteResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_main_card_eeprom_write_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubMainCardEEpromWriteResponse * + stub_main_card_eeprom_write_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubMainCardEEpromWriteResponse *) + protobuf_c_message_unpack (&stub_main_card_eeprom_write_response__descriptor, + allocator, len, data); +} +void stub_main_card_eeprom_write_response__free_unpacked + (StubMainCardEEpromWriteResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_main_card_eeprom_write_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define stub_main_card_eeprom_write_response__field_descriptors NULL +#define stub_main_card_eeprom_write_response__field_indices_by_name NULL +#define stub_main_card_eeprom_write_response__number_ranges NULL +const ProtobufCMessageDescriptor stub_main_card_eeprom_write_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(StubMainCardEEpromWriteResponse), + 0, + stub_main_card_eeprom_write_response__field_descriptors, + stub_main_card_eeprom_write_response__field_indices_by_name, + 0, stub_main_card_eeprom_write_response__number_ranges, + (ProtobufCMessageInit) stub_main_card_eeprom_write_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteResponse.pb-c.h new file mode 100644 index 000000000..21c64bf05 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteResponse.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMainCardEEpromWriteResponse.proto */ + +#ifndef PROTOBUF_C_StubMainCardEEpromWriteResponse_2eproto__INCLUDED +#define PROTOBUF_C_StubMainCardEEpromWriteResponse_2eproto__INCLUDED + +#include + +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 _StubMainCardEEpromWriteResponse StubMainCardEEpromWriteResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubMainCardEEpromWriteResponse +{ + ProtobufCMessage base; +}; +#define STUB_MAIN_CARD_EEPROM_WRITE_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_main_card_eeprom_write_response__descriptor) \ + } + + +/* StubMainCardEEpromWriteResponse methods */ +void stub_main_card_eeprom_write_response__init + (StubMainCardEEpromWriteResponse *message); +size_t stub_main_card_eeprom_write_response__get_packed_size + (const StubMainCardEEpromWriteResponse *message); +size_t stub_main_card_eeprom_write_response__pack + (const StubMainCardEEpromWriteResponse *message, + uint8_t *out); +size_t stub_main_card_eeprom_write_response__pack_to_buffer + (const StubMainCardEEpromWriteResponse *message, + ProtobufCBuffer *buffer); +StubMainCardEEpromWriteResponse * + stub_main_card_eeprom_write_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_main_card_eeprom_write_response__free_unpacked + (StubMainCardEEpromWriteResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubMainCardEEpromWriteResponse_Closure) + (const StubMainCardEEpromWriteResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_main_card_eeprom_write_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubMainCardEEpromWriteResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c index b7a3db982..8454415b5 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c @@ -575,6 +575,7 @@ uint32_t FPGA_MotorConfig_callback(TimerMotors_t _motorId, uint32_t ReadValue) return ERROR; } + switch (ConfigStages[_motorId]) { /*case MOTOR_CONFIG_READ_ADC: - no need done in init 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 ae277ebd5..2b582d71b 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 @@ -326,7 +326,7 @@ uint32_t Prepare_EEPROM_DATA_For_Burning(int Dispenser_ID,StubDispenserEEpromDat Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.Header = dispensereeprom->header; Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.Table_Length = dispensereeprom->tablelength; Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.Table_version = dispensereeprom->tableversion; - Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.Maximal_Pressure = dispensereeprom->minimalpressure; + Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.Minimal_Pressure = dispensereeprom->minimalpressure; Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.Maximal_Pressure = dispensereeprom->maximalpressure; Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.Minimal_MV = dispensereeprom->minimalmv; Dispenser_struct[Dispenser_ID].Write_Disp_EEPROM.bytes.Maximal_MV = dispensereeprom->maximalmv; diff --git a/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.c b/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.c index 61fa0b263..ee125c10b 100644 --- a/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.c +++ b/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.c @@ -12,6 +12,12 @@ #include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h" #include "Common/SW_Info/SW_Info.h" +#include +#include +#include +#include + + uint32_t E2Prom_Data[MAX_EEPROM_STORAGE] = {0,0,0,0,0,0}; uint32_t MCU_E2PromProgram(int Address,uint32_t Data) { @@ -165,4 +171,82 @@ void MCU_E2PromInit(void) EEPROMInit(); #endif } +void MainCardEEpromReadRequestFunc(MessageContainer* requestContainer) +{ + + uint32_t status = PASSED; + MessageContainer responseContainer; + int32_t EEdata = 0; + + StubMainCardEEpromReadRequest* request = stub_main_card_eeprom_read_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + + StubMainCardEEpromReadResponse response = STUB_MAIN_CARD_EEPROM_WRITE_RESPONSE__INIT; + + if (request->has_address == true) + { + response.has_address = true; + response.address = request->address; + + response.has_data = true; + status = MCU_E2PromRead(request->address,&response.data); + + } + else + { + status = ERROR_CODE__INVALID_PARAMETER; + } + responseContainer = createContainer(MESSAGE_TYPE__StubMainCardEEpromReadResponse, requestContainer->token, true, &response, &stub_main_card_eeprom_read_response__pack, &stub_main_card_eeprom_read_response__get_packed_size); + + if (status) + { + responseContainer.has_error = true; + responseContainer.error = status; + } + //------------------------------------------------------------------------------------------- + uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + free(responseContainer.data.data); + SendChars((char*)container_buffer, container_size); + + stub_main_card_eeprom_read_request__free_unpacked(request,NULL); + +} + + +void MainCardEEpromWriteRequestFunc(MessageContainer* requestContainer) +{ + + uint32_t status = PASSED; + MessageContainer responseContainer; + + StubMainCardEEpromWriteRequest* request = stub_main_card_eeprom_write_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + + StubMainCardEEpromWriteResponse response = STUB_MAIN_CARD_EEPROM_WRITE_RESPONSE__INIT; + + if (request->has_address == true) + { + status = MCU_E2PromProgram(request->address,request->data); + } + else + { + status = ERROR_CODE__INVALID_PARAMETER; + } + responseContainer = createContainer(MESSAGE_TYPE__StubMainCardEEpromWriteResponse, requestContainer->token, true, &response, &stub_main_card_eeprom_write_response__pack, &stub_main_card_eeprom_write_response__get_packed_size); + + if (status) + { + responseContainer.has_error = true; + responseContainer.error = status; + } + + + //------------------------------------------------------------------------------------------- + uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + free(responseContainer.data.data); + SendChars((char*)container_buffer, container_size); + + stub_main_card_eeprom_write_request__free_unpacked(request,NULL); + +} diff --git a/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.h b/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.h index 3ad399159..381db2141 100644 --- a/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.h +++ b/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.h @@ -62,6 +62,9 @@ void MCU_E2PromProgramMidTank(int midtankId,float a,float b); float MCU_E2PromReadMidtank_A(int MidtankId); float MCU_E2PromReadMidtank_B(int MidtankId); void MCU_E2PromInit(void); + +void MainCardEEpromWriteRequestFunc(MessageContainer* requestContainer); +void MainCardEEpromReadRequestFunc(MessageContainer* requestContainer); //uint32_t MCU_E2PromSerialNumProgram(char *Data); //uint32_t MCU_E2PromSerialNumRead(char* *Data); uint32_t MCU_E2PromEmbeddedVersionProgram(void); diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index 9c924eaec..0762db00e 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -539,7 +539,7 @@ void AlarmHandlingInit(void) Error_init(&eb); - AlarmHandlingMsgQ = Mailbox_create(sizeof(AlarmHandlingMessageStruc), 20, NULL,&eb); + AlarmHandlingMsgQ = Mailbox_create(sizeof(AlarmHandlingMessageStruc), 40, NULL,&eb); int Alarm_i; for (Alarm_i = 0;Alarm_i < MAX_SYSTEM_ALARMS;Alarm_i++) diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index 3406a75ae..035a3b3b3 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -777,11 +777,11 @@ void FlashInitAndLoad(void) StoreDancerConfigMessage(); Report("Dancer Initialized", __FILE__,DancersCfg[0].zeropoint,DancersCfg[1].zeropoint, RpMessage, DancersCfg[2].zeropoint, 0); - Bytes = AlarmHandlingLoadFile(); + /*Bytes = AlarmHandlingLoadFile(); if (Bytes>0) { Report("Alarm Initialized from file", __FILE__,__LINE__,Bytes, RpMessage, ALARM_MAP_IN_FLASH, 0); - } + }*/ EraseFlashSection(EMBEDDED_PARAMETERS_SECTION_FLASH); Fresult = FileRead(EmbeddedParametersPath, &Bytes, &buffer); @@ -804,20 +804,23 @@ void FlashInitAndLoad(void) Report("Parameters Initialized from default", __FILE__,__LINE__,sizeof(EmbeddedParameters), RpMessage, EMBEDDED_PARAMETERS_MAP_IN_FLASH, 0); } - Fresult = FileRead(ProcessParamsPath, &Bytes, &buffer); + /*Fresult = FileRead(ProcessParamsPath, &Bytes, &buffer); if (Fresult == FR_OK) { request = upload_process_parameters_request__unpack(NULL, Bytes, buffer); - ProcessParams = request->processparameters; - Bytes = sizeof(ProcessParams); - ReadAppAndProgram(PROCESS_PARAMETERS_MAP_IN_FLASH, 4,&Bytes); - ReadAppAndProgram(PROCESS_PARAMETERS_MAP_IN_FLASH+4, Bytes, &ProcessParams); - upload_process_parameters_request__free_unpacked(request,NULL); - FlashInitResults[2] = true; - Report("Process Initialized", __FILE__,__LINE__,Bytes, RpMessage, (int)ProcessParams->dryerzone1temp, 0); + if (request) + { + ProcessParams = request->processparameters; + Bytes = sizeof(ProcessParams); + ReadAppAndProgram(PROCESS_PARAMETERS_MAP_IN_FLASH, 4,&Bytes); + ReadAppAndProgram(PROCESS_PARAMETERS_MAP_IN_FLASH+4, Bytes, &ProcessParams); + upload_process_parameters_request__free_unpacked(request,NULL); + FlashInitResults[2] = true; + Report("Process Initialized", __FILE__,__LINE__,Bytes, RpMessage, (int)ProcessParams->dryerzone1temp, 0); + } } else - Report("Process not Initialized", __FILE__,__LINE__,0, RpMessage, 0, 0); + Report("Process not Initialized", __FILE__,__LINE__,0, RpMessage, 0, 0);*/ #ifdef WATCHDOG ROM_WatchdogResetEnable(WATCHDOG0_BASE); timeout = 120000000*3; diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h index aeec7d696..0220d1a6c 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h @@ -11,6 +11,7 @@ extern EventType HeaterEventType[HEATER_TYPE_MAX_HEATERS]; extern EventType HeaterUnderEventType[HEATER_TYPE_MAX_HEATERS]; extern EventType HeaterUnderEventType_B[HEATER_TYPE_MAX_HEATERS]; +extern bool specialHeaterState; extern uint32_t stub_heating_limit; //uint32_t HeaterCommandRequestMessage(MessageContainer* requestContainer); diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index 95441d1a6..380eb99ca 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -392,6 +392,7 @@ uint32_t LoadHeaterSetPoint(HeaterType HeaterType) } return HeaterCmd[HeaterType].targettemperatue; } +bool specialHeaterState = false; void LoadHeaterState(HeaterType HeaterType,HeaterState *HeaterState) { int HeaterId = HeaterType; @@ -415,11 +416,19 @@ void LoadHeaterState(HeaterType HeaterType,HeaterState *HeaterState) { HeaterState->setpoint = HeaterControl[HEATER_TYPE__DryerMainHeater].outputproportionalpowerlimit; //HeaterState->isrampingup = InitialHeating; + if (specialHeaterState == true) + { + HeaterState->setpoint = HeaterPIDConfig[HEATER_TYPE__DryerAirHeater].m_integral/10000; + } } if (HeaterId == HEATER_TYPE__DryerSecondaryHeater) { HeaterState->setpoint = HeaterControl[HEATER_TYPE__DryerSecondaryHeater].outputproportionalpowerlimit; //HeaterState->isrampingup = InitialHeating; + if (specialHeaterState == true) + { + HeaterState->setpoint = HeaterPIDConfig[HEATER_TYPE__DryerAirHeater].m_calculatedError/100; + } } return; } @@ -1582,13 +1591,22 @@ double TotalCurrentLimit(double VAC) } } +uint8_t Histeresis = 0; + uint32_t DrierHeaterVoltageSetup(void) { double DrierAcVoltage = 0.0; char str[100]; bool tempDrier2 = UseSecondaryDrierHeater; - double Z1Current,Z2AssumedCurrent,LimitCurrent; + double Z1Current = 0,Z2AssumedCurrent = 0,LimitCurrent = 0; + if ((Histeresis>0)&&(Histeresis<4)) + { + Histeresis++; + REPORT_MSG(Histeresis, "AC handling Histeresis"); + return OK; + } + Histeresis = 0; #ifndef VAC_TEST if (Head_Type > HEAD_TYPE_SYLKO_WITHOUT_CARD) //rapid/pp machines #endif @@ -1639,8 +1657,9 @@ uint32_t DrierHeaterVoltageSetup(void) #endif if (tempDrier2 != UseSecondaryDrierHeater) { + Histeresis = 1; usnprintf(str, 100, "Changing Drier 2 from %d to %d VAC %d D1 Current %d D2 assumed current %d limit %d" ,tempDrier2,UseSecondaryDrierHeater - ,(int)DrierAcVoltage,(int)(Z1Current*100),(int)(Z2AssumedCurrent*100),(int)(LimitCurrent*100)); + ,(int)DrierAcVoltage,(int)(Z1Current*100),(int)(Z2AssumedCurrent*100),(int)(abs(LimitCurrent)*100)); ReportWithPackageFilter(HeatersFilter,str, __FILE__,__LINE__,DrierAcVoltage, RpMessage, UseSecondaryDrierHeater, 0); if (UseSecondaryDrierHeater == false) { diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c index 501899d7e..8d736f352 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -887,7 +887,15 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) } #endif + else + if(request->amount == 0xB7) //fast refresh for pressure + { + specialHeaterState = request->delay?true:false; + LOG_ERROR(specialHeaterState,"set specialHeaterState"); + response.progress = specialHeaterState; + response.has_progress = true; + } else if(request->amount == 0xC3) //suspend I2C task { diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index 2ad58ea0a..a91781ce4 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -322,8 +322,11 @@ //HARDWARE_MOTOR_TYPE__MOTO_DH_LID = 2, //HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID = 4, //DeActivateHeadMagnet(); - CallbackCounter++; - MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_DH_LID,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DH_LID].directionthreadwize, 200, Motor_Id_to_LS_IdUp[HARDWARE_MOTOR_TYPE__MOTO_DH_LID], Thread_Load_HomingCallback,10000); + if (Head_Type != HEAD_TYPE_STAPLE_SPUN) + { + CallbackCounter++; + MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_DH_LID,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DH_LID].directionthreadwize, 200, Motor_Id_to_LS_IdUp[HARDWARE_MOTOR_TYPE__MOTO_DH_LID], Thread_Load_HomingCallback,10000); + } CallbackCounter++; //MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID].directionthreadwize, 200, Motor_Id_to_LS_IdUp[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID], Thread_Load_HomingCallback,10000); int direction; @@ -336,9 +339,12 @@ direction = DRIER_LID_OPEN; } MotorGotoWithCallback(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID, direction, Motor_Id_to_LS_IdUp[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID], Thread_Load_HomingCallback,10000); - Report("Thread_Load_Lift_actuators",__FILE__,__LINE__,LOW,RpMessage,false,0); - Trigger_Head_Actuators_Control(ACTOT, LOW,true); - Trigger_Head_Actuators_Control(ACTIN, LOW,true); + if (Head_Type == HEAD_TYPE_SYLKO) + { + Report("Thread_Load_Lift_actuators",__FILE__,__LINE__,LOW,RpMessage,false,0); + Trigger_Head_Actuators_Control(ACTOT, LOW,true); + Trigger_Head_Actuators_Control(ACTIN, LOW,true); + } return OK; } uint32_t Thread_Load_Lift_Dancers(void) @@ -455,8 +461,11 @@ //Close Dyeing Head Cover And Dryer Lid //HARDWARE_MOTOR_TYPE__MOTO_DH_LID = 2, //HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID = 4, - CallbackCounter++; - MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_DH_LID,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DH_LID].directionthreadwize, 200, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_DH_LID], Thread_Load_HomingCallback,10000); + if (Head_Type != HEAD_TYPE_STAPLE_SPUN) + { + CallbackCounter++; + MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_DH_LID,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DH_LID].directionthreadwize, 200, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_DH_LID], Thread_Load_HomingCallback,10000); + } CallbackCounter++; // MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID].directionthreadwize, 200, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID], Thread_Load_HomingCallback,10000); int direction; @@ -469,9 +478,12 @@ direction = DRIER_LID_CLOSE; } MotorGotoWithCallback(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID, direction, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID], Thread_Load_HomingCallback,10000); - Report("Thread_Load_Close_actuators",__FILE__,__LINE__,LOW,RpMessage,true,0); - Trigger_Head_Actuators_Control(ACTOT, LOW,false); - Trigger_Head_Actuators_Control(ACTIN, LOW,false); + if (Head_Type == HEAD_TYPE_SYLKO) + { + Report("Thread_Load_Close_actuators",__FILE__,__LINE__,LOW,RpMessage,true,0); + Trigger_Head_Actuators_Control(ACTOT, LOW,false); + Trigger_Head_Actuators_Control(ACTIN, LOW,false); + } return OK; } uint32_t Thread_Load_Resume_Heating(void) diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 386b34f49..545fb40e6 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -877,7 +877,7 @@ uint32_t ThreadPrepare_Tension (int DancerId, double tension) break; case HARDWARE_DANCER_TYPE__RightDancer: return Adjust_Right_TFU_Tension(tension); - break; + //break; default: return ERROR; } diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index b8b8724f5..be3b64f0a 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -193,6 +193,8 @@ static ReturnCode PrepareState(void *JobDetails) retcode = JobSuccess; //start (fast??) heating DiagnosticsStart(); + usnprintf(ErrorMsg, 80,"Configured Thrd %d Wind %d IDS %d Heat %d WHS %d",Configured[Module_Thread],Configured[Module_Winder],Configured[Module_IDS],Configured[Module_Heaters],Configured[Module_Waste]); + Report(ErrorMsg, __FILE__, __LINE__, 0, RpWarning, 0, 0); if (Configured[Module_IDS]) { @@ -369,16 +371,16 @@ uint32_t ThreadJoggingFunc(int speed) { ProcessParameters ProcessParametersCopy; uint32_t status = OK; - if (JobIsActive() == true) + if ((JobIsActive() == true)||(JoggingJobActive == true)) { status = ERROR; - LOG_ERROR(JobIsActive(),"Jog JobIsActive"); + Report("Jog JobIsActive", __FILE__, __LINE__, JobIsActive(), RpWarning, JoggingJobActive, 0); } else { - memcpy(&CopyConfigured,&Configured,sizeof(CopyConfigured)); - usnprintf(ErrorMsg, 80,"Copy Configured T %d W %d I %d H %d W %d",CopyConfigured[Module_Thread],CopyConfigured[Module_Winder],CopyConfigured[Module_IDS],CopyConfigured[Module_Heaters],CopyConfigured[Module_Waste]); - Report(ErrorMsg, __FILE__, __LINE__, 0, RpWarning, 0, 0); + //memcpy(&CopyConfigured,&Configured,sizeof(CopyConfigured)); + //usnprintf(ErrorMsg, 80,"Copy Configured T %d W %d I %d H %d W %d",CopyConfigured[Module_Thread],CopyConfigured[Module_Winder],CopyConfigured[Module_IDS],CopyConfigured[Module_Heaters],CopyConfigured[Module_Waste]); + //Report(ErrorMsg, __FILE__, __LINE__, 0, RpWarning, 0, 0); JoggingJobActive = true; //set the job handler to ignore heaters, ids and waste in the state machine @@ -534,10 +536,10 @@ uint32_t ThreadCleaningJob(int speed) } else { - memcpy(&CopyConfigured,&Configured,sizeof(CopyConfigured)); + //memcpy(&CopyConfigured,&Configured,sizeof(CopyConfigured)); CleaningJobActive = true; - usnprintf(ErrorMsg, 80,"Copy Configured T %d W %d I %d H %d W %d",CopyConfigured[Module_Thread],CopyConfigured[Module_Winder],CopyConfigured[Module_IDS],CopyConfigured[Module_Heaters],CopyConfigured[Module_Waste]); - Report(ErrorMsg, __FILE__, __LINE__, 0, RpWarning, 0, 0); + //usnprintf(ErrorMsg, 80,"Copy Configured T %d W %d I %d H %d W %d",CopyConfigured[Module_Thread],CopyConfigured[Module_Winder],CopyConfigured[Module_IDS],CopyConfigured[Module_Heaters],CopyConfigured[Module_Waste]); + //Report(ErrorMsg, __FILE__, __LINE__, 0, RpWarning, 0, 0); //set the job handler to ignore heaters, ids and waste in the state machine Configured[Module_Thread] = true; @@ -645,8 +647,8 @@ void ThreadAbortJoggingFunc(void) AbortJob(0); //set the job handler to handle heaters, ids and waste in the state machine Task_sleep(100); //let the job end procedure role before returning the configuration to normal. - usnprintf(ErrorMsg, 80,"Copy Configured T %d W %d I %d H %d W %d",CopyConfigured[Module_Thread],CopyConfigured[Module_Winder],CopyConfigured[Module_IDS],CopyConfigured[Module_Heaters],CopyConfigured[Module_Waste]); - Report(ErrorMsg, __FILE__, __LINE__, 0, RpWarning, 0, 0); + //usnprintf(ErrorMsg, 80,"Copy Configured T %d W %d I %d H %d W %d",CopyConfigured[Module_Thread],CopyConfigured[Module_Winder],CopyConfigured[Module_IDS],CopyConfigured[Module_Heaters],CopyConfigured[Module_Waste]); + //Report(ErrorMsg, __FILE__, __LINE__, 0, RpWarning, 0, 0); my_free(Ticket.segments); @@ -911,6 +913,7 @@ void JobRequestFunc(MessageContainer* requestContainer) if (status == PASSED) { Report("Job Request ",__FILE__,__LINE__,Ticket->processparameters->dyeingspeed,RpWarning,n_segments, Ticket->intersegmentlength); + memcpy(&Configured,&JobConfigured,sizeof(JobConfigured)); StartJob(CurrentJob); } } diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c index a8490556b..982687201 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c @@ -79,6 +79,7 @@ ModuleStateEnum PrintWaiting[MAX_SYSTEM_MODULES] = {ModuleIdle,ModuleIdle,M ModuleStateEnum EndWaiting[MAX_SYSTEM_MODULES] = {ModuleIdle,ModuleIdle,ModuleIdle,ModuleIdle,ModuleIdle}; bool Configured[MAX_SYSTEM_MODULES] = {false,false,false,false,false}; +bool JobConfigured[MAX_SYSTEM_MODULES] = {false,false,false,false,false}; bool SuspendLargeMessages = false; /* @@ -355,6 +356,7 @@ uint32_t PrintingHWConfiguration(void *Configuration) } } }*/ + memcpy(&JobConfigured,&Configured,sizeof(JobConfigured)); return OK; @@ -644,16 +646,16 @@ uint32_t EndState(void *JobDetails, char *Message) if (JoggingJobActive == true) { JoggingJobActive = false; - memcpy(&Configured,&CopyConfigured,sizeof(CopyConfigured)); - usnprintf(ErMsg, 80,"Copy Configured T %d W %d I %d H %d W %d",CopyConfigured[Module_Thread],CopyConfigured[Module_Winder],CopyConfigured[Module_IDS],CopyConfigured[Module_Heaters],CopyConfigured[Module_Waste]); - Report(ErMsg, __FILE__, __LINE__, 0, RpWarning, 0, 0); + //memcpy(&Configured,&CopyConfigured,sizeof(CopyConfigured)); + //usnprintf(ErMsg, 80,"Copy Configured T %d W %d I %d H %d W %d",CopyConfigured[Module_Thread],CopyConfigured[Module_Winder],CopyConfigured[Module_IDS],CopyConfigured[Module_Heaters],CopyConfigured[Module_Waste]); + //Report(ErMsg, __FILE__, __LINE__, 0, RpWarning, 0, 0); } if (CleaningJobActive == true) { CleaningJobActive = false; - memcpy(&Configured,&CopyConfigured,sizeof(CopyConfigured)); - usnprintf(ErMsg, 80,"Copy Configured T %d W %d I %d H %d W %d",CopyConfigured[Module_Thread],CopyConfigured[Module_Winder],CopyConfigured[Module_IDS],CopyConfigured[Module_Heaters],CopyConfigured[Module_Waste]); - Report(ErMsg, __FILE__, __LINE__, 0, RpWarning, 0, 0); + //memcpy(&Configured,&CopyConfigured,sizeof(CopyConfigured)); + //usnprintf(ErMsg, 80,"Copy Configured T %d W %d I %d H %d W %d",CopyConfigured[Module_Thread],CopyConfigured[Module_Winder],CopyConfigured[Module_IDS],CopyConfigured[Module_Heaters],CopyConfigured[Module_Waste]); + //Report(ErMsg, __FILE__, __LINE__, 0, RpWarning, 0, 0); } return OK; diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.h b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.h index 811250bbd..de3191a85 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.h +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.h @@ -144,6 +144,8 @@ typedef struct PrintMessage{ }PrintMessageStruc; extern bool Configured[MAX_SYSTEM_MODULES]; +extern bool JobConfigured[MAX_SYSTEM_MODULES]; + extern ModuleStateEnum PrepareWaiting[MAX_SYSTEM_MODULES]; extern JobTicket *CurrentJob; //extern JobTicket *PreviousJob; diff --git a/Software/PMR/Messages/Common/MessageType.proto b/Software/PMR/Messages/Common/MessageType.proto index 7b30ea8fe..4ce14ff6b 100644 --- a/Software/PMR/Messages/Common/MessageType.proto +++ b/Software/PMR/Messages/Common/MessageType.proto @@ -119,6 +119,10 @@ enum MessageType StubDispenserEEpromResponse = 106; StubWhsEEpromRequest = 107; StubWhsEEpromResponse = 108; + StubMainCardEEpromReadRequest = 109; + StubMainCardEEpromReadResponse = 110; + StubMainCardEEpromWriteRequest = 111; + StubMainCardEEpromWriteResponse = 112; //------------------------------------ diff --git a/Software/PMR/Messages/Stubs/StubMainCardEEpromReadRequest.proto b/Software/PMR/Messages/Stubs/StubMainCardEEpromReadRequest.proto new file mode 100644 index 000000000..a1cb0c9ef --- /dev/null +++ b/Software/PMR/Messages/Stubs/StubMainCardEEpromReadRequest.proto @@ -0,0 +1,11 @@ + +syntax = "proto3"; + +package Tango.PMR.Stubs; +option java_package = "com.twine.tango.pmr.stubs"; + +message StubMainCardEEpromReadRequest +{ + int32 Address = 1; + int32 Data = 2; +} diff --git a/Software/PMR/Messages/Stubs/StubMainCardEEpromReadResponse.proto b/Software/PMR/Messages/Stubs/StubMainCardEEpromReadResponse.proto new file mode 100644 index 000000000..a9197ee28 --- /dev/null +++ b/Software/PMR/Messages/Stubs/StubMainCardEEpromReadResponse.proto @@ -0,0 +1,11 @@ + +syntax = "proto3"; + +package Tango.PMR.Stubs; +option java_package = "com.twine.tango.pmr.stubs"; + +message StubMainCardEEpromReadResponse +{ + int32 Address = 1; + int32 Data = 2; +} diff --git a/Software/PMR/Messages/Stubs/StubMainCardEEpromWriteRequest.proto b/Software/PMR/Messages/Stubs/StubMainCardEEpromWriteRequest.proto new file mode 100644 index 000000000..cfeb392bf --- /dev/null +++ b/Software/PMR/Messages/Stubs/StubMainCardEEpromWriteRequest.proto @@ -0,0 +1,11 @@ + +syntax = "proto3"; + +package Tango.PMR.Stubs; +option java_package = "com.twine.tango.pmr.stubs"; + +message StubMainCardEEpromWriteRequest +{ + int32 Address = 1; + int32 Data = 2; +} diff --git a/Software/PMR/Messages/Stubs/StubMainCardEEpromWriteResponse.proto b/Software/PMR/Messages/Stubs/StubMainCardEEpromWriteResponse.proto new file mode 100644 index 000000000..f1e8a8897 --- /dev/null +++ b/Software/PMR/Messages/Stubs/StubMainCardEEpromWriteResponse.proto @@ -0,0 +1,10 @@ + +syntax = "proto3"; + +package Tango.PMR.EmbeddedParameters; +option java_package = "com.twine.tango.pmr.embeddedparameters"; + +message StubMainCardEEpromWriteResponse +{ + +} -- cgit v1.3.1 From 8da33fbc50ad0f44b83650ff84f1b73bf91bd58b Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Fri, 5 Jun 2020 18:12:02 +0300 Subject: release notes for 1.4.6.30 --- .../Embedded/Common/SWUpdate/FirmwareUpgrade.c | 26 +++++++++++----------- .../Embedded/Software Release Notes.txt | 19 ++++++++++++++-- 2 files changed, 30 insertions(+), 15 deletions(-) (limited to 'Software') diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c index d6e391e87..f39f6a5eb 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c @@ -100,7 +100,7 @@ uint32_t ActivateVersionRequestFunc(MessageContainer* requestContainer) uint32_t Bytes = 0; char SWUpgradePath[100]; char FullPath[50]; - FRESULT Fresult = FR_OK; + FRESULT Fresult = FR_OK , FFresult = FR_OK; FILINFO* fno = 0; fno = my_malloc(sizeof(FILINFO)); @@ -157,25 +157,25 @@ uint32_t ActivateVersionRequestFunc(MessageContainer* requestContainer) break; case VERSION_FILE_DESTINATION__ConfigParams: usnprintf(FullPath, 50, "%s%s%s", request->path,"/", VersionPackage->filedescriptors[File_i]->filename); - Fresult = f_unlink("//SYSINFO//EMBPARAM.CFG"); - Fresult |= f_rename (FullPath, "//SYSINFO//EMBPARAM.CFG"); + FFresult = f_unlink("//SYSINFO//EMBPARAM.CFG"); + FFresult |= f_rename (FullPath, "//SYSINFO//EMBPARAM.CFG"); LoadConfigurationParamsFromFile(true); - Report("ConfigParams",__FILE__,Fresult,(int)NumberOfFiles,RpWarning,CurrentRunningFile,0); + Report("ConfigParams",__FILE__,FFresult,(int)NumberOfFiles,RpWarning,CurrentRunningFile,0); CurrentRunningFile++; break; case VERSION_FILE_DESTINATION__ProcessParams: usnprintf(FullPath, 50, "%s%s%s", request->path,"/", VersionPackage->filedescriptors[File_i]->filename); - Fresult = f_unlink("//SYSINFO//PROCESSP.CFG"); - Fresult |= f_rename (FullPath, "//SYSINFO//PROCESSP.CFG"); + FFresult = f_unlink("//SYSINFO//PROCESSP.CFG"); + FFresult |= f_rename (FullPath, "//SYSINFO//PROCESSP.CFG"); LoadProcessParamsFromFile(); - Report("ProcessParams",__FILE__,Fresult,(int)NumberOfFiles,RpWarning,CurrentRunningFile,0); + Report("ProcessParams",__FILE__,FFresult,(int)NumberOfFiles,RpWarning,CurrentRunningFile,0); CurrentRunningFile++; break; case VERSION_FILE_DESTINATION__AlarmParams: usnprintf(FullPath, 50, "%s%s%s", request->path,"/", VersionPackage->filedescriptors[File_i]->filename); - Fresult = f_unlink("//SYSINFO//ALARM.CFG"); - Fresult |= f_rename (FullPath, "//SYSINFO//ALARM.CFG"); - Report("AlarmParams",__FILE__,Fresult,(int)NumberOfFiles,RpWarning,CurrentRunningFile,0); + FFresult = f_unlink("//SYSINFO//ALARM.CFG"); + FFresult |= f_rename (FullPath, "//SYSINFO//ALARM.CFG"); + Report("AlarmParams",__FILE__,FFresult,(int)NumberOfFiles,RpWarning,CurrentRunningFile,0); //AlarmHandlingLoadFile(); FlashInit(); Reboot = true; @@ -183,9 +183,9 @@ uint32_t ActivateVersionRequestFunc(MessageContainer* requestContainer) break; case VERSION_FILE_DESTINATION__GeneralHWConfigParams: usnprintf(FullPath, 50, "%s%s%s", request->path,"/", VersionPackage->filedescriptors[File_i]->filename); - Fresult = f_unlink("//SYSINFO//GENHWCFG.CFG"); - Fresult |= f_rename (FullPath, "//SYSINFO//GENHWCFG.CFG"); - Report("GeneralHWConfigParams",__FILE__,Fresult,(int)NumberOfFiles,RpWarning,CurrentRunningFile,0); + FFresult = f_unlink("//SYSINFO//GENHWCFG.CFG"); + FFresult |= f_rename (FullPath, "//SYSINFO//GENHWCFG.CFG"); + Report("GeneralHWConfigParams",__FILE__,FFresult,(int)NumberOfFiles,RpWarning,CurrentRunningFile,0); HWConfigurationLoadFile(); CurrentRunningFile++; break; diff --git a/Software/Embedded_SW/Embedded/Software Release Notes.txt b/Software/Embedded_SW/Embedded/Software Release Notes.txt index 57779a020..8a76e6ee4 100644 --- a/Software/Embedded_SW/Embedded/Software Release Notes.txt +++ b/Software/Embedded_SW/Embedded/Software Release Notes.txt @@ -1,4 +1,20 @@ -Embedded SW Release note - Version 1.4.6.29 - Pack 2 +Embedded SW Release note - Version 1.4.6.30 - Pack 2+ +============================================================= +fix firmware update when no files +add main CPU EEPROM Read/Write from stub +support new FPGA - different clocks (EMC) +remove ADC interrupt - polling only +read air flow from arc head - prepare +fix head identification on head hw failure +improve WHS air flow control +fix FlashInitAndLoad() (although not in use) +fix (?) dryer heating. lots of logs added, VAC control - histeresys added +start blower increase a bit later to solve the temerature alarms preventing jobs +maximal pressure buildup 2.5 +prevent job when head/drier wide open +thread load - skip head lid and actuators according to head type + +Embedded SW Release note - Version 1.4.6.29 - Pack 2 ============================================================= dispenser EEPROM read/write from stub power up interface - progress report and error codes @@ -28,7 +44,6 @@ cartridge presence info in tech board. spool precence check and status - for PP machines feeder tension upper level support - Embedded SW Release note - Version 1.4.6.21 - Pack 1++ ============================================================= File system improved -- cgit v1.3.1 From 714c2fd7941c3f65e363a3d9cc33765c746f0c59 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sun, 7 Jun 2020 09:50:29 +0300 Subject: Refined touch simulation test. --- .../Tango.SimulateTouch.UI/MainWindow.xaml | 27 ++-- .../Tango.SimulateTouch.UI/MainWindow.xaml.cs | 165 +++++++-------------- .../Tango.SimulateTouch.UI/Native/TouchSimulate.cs | 1 + .../Tango.SimulateTouch.UI.csproj | 1 + .../Tango.SimulateTouch.UI/TouchController.cs | 81 ++++++++++ 5 files changed, 152 insertions(+), 123 deletions(-) create mode 100644 Software/Visual_Studio/Tango.SimulateTouch.UI/TouchController.cs (limited to 'Software') diff --git a/Software/Visual_Studio/Tango.SimulateTouch.UI/MainWindow.xaml b/Software/Visual_Studio/Tango.SimulateTouch.UI/MainWindow.xaml index 5c7075e8a..1bca41386 100644 --- a/Software/Visual_Studio/Tango.SimulateTouch.UI/MainWindow.xaml +++ b/Software/Visual_Studio/Tango.SimulateTouch.UI/MainWindow.xaml @@ -5,19 +5,18 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:Tango.SimulateTouch.UI" mc:Ignorable="d" - Title="MainWindow" Height="450" Width="800" > - - - - - - - - - - - - + Title="MainWindow" Height="450" Width="800" WindowState="Maximized"> + + + + + + + + + + + + diff --git a/Software/Visual_Studio/Tango.SimulateTouch.UI/MainWindow.xaml.cs b/Software/Visual_Studio/Tango.SimulateTouch.UI/MainWindow.xaml.cs index 33181b13d..27f316bb3 100644 --- a/Software/Visual_Studio/Tango.SimulateTouch.UI/MainWindow.xaml.cs +++ b/Software/Visual_Studio/Tango.SimulateTouch.UI/MainWindow.xaml.cs @@ -15,6 +15,7 @@ using System.Windows.Navigation; using System.Windows.Shapes; using Tango.SimulateTouch.UI.Native; using System.Security.Cryptography; +using System.Threading; namespace Tango.SimulateTouch.UI { @@ -23,129 +24,75 @@ namespace Tango.SimulateTouch.UI /// public partial class MainWindow : Window { - //Windows.UI.Input.Preview.Injection.InputInjector _inputInjector; - private Line ProxyLine; + private Point downPosition; public MainWindow() { InitializeComponent(); - WindowState = WindowState.Maximized; - TouchInjector.InitializeTouchInjection(); - this.TouchDown += MainWindow_TouchDown; - this.TouchMove += MainWindow_TouchMove; - this.TouchUp += MainWindow_TouchUp; + + TouchController.Init(); + + rect.TouchDown += Rect_TouchDown; + rect.TouchUp += Rect_TouchUp; + rect.TouchMove += Rect_TouchMove; } - private void MainWindow_TouchUp(object sender, TouchEventArgs e) + + private void Rect_TouchDown(object sender, TouchEventArgs e) { - System.Windows.Input.TouchPoint oPos = e.GetTouchPoint(this); - this.ProxyLine.X2 = oPos.Position.X; - this.ProxyLine.Y2 = oPos.Position.Y; - this.GdRootZm.Children.Add(this.ProxyLine); - Console.WriteLine("TouchID " + e.TouchDevice.Id + " TouchUp " + oPos.Position.X + " " + oPos.Position.Y); - TouchUpTextBlock.Text = "TOUCH UP"; + downPosition = e.GetTouchPoint(rect).Position; + rect.Fill = Brushes.Blue; } - private void MainWindow_TouchMove(object sender, TouchEventArgs e) + private void Rect_TouchUp(object sender, TouchEventArgs e) { - System.Windows.Input.TouchPoint oPos = e.GetTouchPoint(this); - Console.WriteLine("TouchID " + e.TouchDevice.Id + " TouchMove " + oPos.Position.X + " " + oPos.Position.Y); + rect.Fill = Brushes.Red; } - private void MainWindow_TouchDown(object sender, TouchEventArgs e) + private void Rect_TouchMove(object sender, TouchEventArgs e) { - System.Windows.Input.TouchPoint oPos = e.GetTouchPoint(this); - Line oLine = new Line(); - oLine.Stroke = new SolidColorBrush(Colors.Red); - oLine.StrokeThickness = 2; - oLine.X1 = oPos.Position.X; - oLine.Y1 = oPos.Position.Y; - this.ProxyLine = oLine; - Console.WriteLine("TouchID " + e.TouchDevice.Id + " TouchDown " + oPos.Position.X + " " + oPos.Position.Y); - messageTextBlock.Text = "TOUCH Down"; + var position = e.GetTouchPoint(rect).Position; + + Canvas.SetLeft(rect, (Canvas.GetLeft(rect) + position.X) - downPosition.X); + Canvas.SetTop(rect, (Canvas.GetTop(rect) + position.Y) - downPosition.Y); } - - private void OnButtonLeftButtonDown(object sender, MouseButtonEventArgs e) + + private void BtnStart_Click(object sender, RoutedEventArgs e) { - // Point targetLoc = messageTextBlock.PointToScreen(new Point(0, 0)); - // HwndSource source = (HwndSource)HwndSource.FromVisual(messageTextBlock); - // IntPtr hWnd = source.Handle; - Console.WriteLine("OnButtonLeftButtonDown"); - - TouchSimulate ts = new TouchSimulate(); - - //TEST UWP - error COM!!!! - /* _inputInjector = InputInjector.TryCreate(); - if (_inputInjector != null) - { - _inputInjector.InitializeTouchInjection( InjectedInputVisualizationMode.Default); - uint pointerId = 1; - var appBounds = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().VisibleBounds; - Point appBoundsTopLeft = new Point(appBounds.Left, appBounds.Top); - Point targetLoc = messageTextBlock.PointToScreen(new Point(0, 0)); - - // Get the screen coordinates (relative to the input area) - // of the input pointer. - Point screenPointPosition = button.PointToScreen(coordinates); - int pointerPointX = (int)screenPointPosition.X; - int pointerPointY = (int)screenPointPosition.Y; - - // Create the point for input injection and calculate its screen location. - Point injectionPoint = - new Point( - appBoundsTopLeft.X + targetLoc.X + pointerPointX, - appBoundsTopLeft.Y + targetLoc.Y + pointerPointY); - - // Create a touch data point for pointer down. - // Each element in the touch data list represents a single touch contact. - // For this example, we're mirroring a single mouse pointer. - List touchData = new List - { - new InjectedInputTouchInfo - { - Contact = new InjectedInputRectangle - { - Left = 30, Top = 30, Bottom = 30, Right = 30 - }, - PointerInfo = new InjectedInputPointerInfo - { - PointerId = pointerId, - PointerOptions = - InjectedInputPointerOptions.PointerDown | - InjectedInputPointerOptions.InContact | - InjectedInputPointerOptions.New, - TimeOffsetInMilliseconds = 0, - PixelLocation = new InjectedInputPoint - { - PositionX = (int)injectionPoint.X , - PositionY = (int)injectionPoint.Y - } - }, - Pressure = 1.0, - TouchParameters = - InjectedInputTouchParameters.Pressure | - InjectedInputTouchParameters.Contact - } - }; - - // Inject the touch input. - _inputInjector.InjectTouchInput(touchData); - - // Create a touch data point for pointer up. - touchData = new List - { - new InjectedInputTouchInfo - { - PointerInfo = new InjectedInputPointerInfo - { - PointerId = pointerId, - PointerOptions = InjectedInputPointerOptions.PointerUp - } - } - }; - - // Inject the touch input. - _inputInjector.InjectTouchInput(touchData); - }*/ + Point rectPosition = rect.PointToScreen(new Point(0, 0)); + Size rectSize = new Size(rect.ActualWidth, rect.ActualHeight); + + Point lastDelta = new Point(0, 0); + bool completed = false; + + Thread t = new Thread(() => + { + TouchController.TouchDown((int)(rectPosition.X + rectSize.Width / 2), (int)(rectPosition.Y + rectSize.Height / 2)); //Touch the middle of the red rectangle. + + Task.Factory.StartNew(() => //This is necessary to keep the touch session alive. + { + while (!completed) + { + TouchController.TouchMove((int)lastDelta.X, (int)lastDelta.Y); + Thread.Sleep(100); + } + }); + + Thread.Sleep(1000); + + for (int i = 0; i < 51; i++) //Animate movement. + { + TouchController.TouchMove(i, i); + lastDelta = new Point(i, i); + Thread.Sleep(300); + } + + completed = true; + + TouchController.TouchUp(); //Complete the touch. + + }); + t.IsBackground = true; + t.Start(); } } } diff --git a/Software/Visual_Studio/Tango.SimulateTouch.UI/Native/TouchSimulate.cs b/Software/Visual_Studio/Tango.SimulateTouch.UI/Native/TouchSimulate.cs index 05c73217f..f0fd1095e 100644 --- a/Software/Visual_Studio/Tango.SimulateTouch.UI/Native/TouchSimulate.cs +++ b/Software/Visual_Studio/Tango.SimulateTouch.UI/Native/TouchSimulate.cs @@ -15,6 +15,7 @@ namespace Tango.SimulateTouch.UI.Native int y = this.GetRandomSeed().Next(50, 1080 - 100); SimulateTouch(x, y); } + private Random GetRandomSeed() { byte[] bytes = new byte[4]; diff --git a/Software/Visual_Studio/Tango.SimulateTouch.UI/Tango.SimulateTouch.UI.csproj b/Software/Visual_Studio/Tango.SimulateTouch.UI/Tango.SimulateTouch.UI.csproj index c632e82e0..b9f562c61 100644 --- a/Software/Visual_Studio/Tango.SimulateTouch.UI/Tango.SimulateTouch.UI.csproj +++ b/Software/Visual_Studio/Tango.SimulateTouch.UI/Tango.SimulateTouch.UI.csproj @@ -55,6 +55,7 @@ MSBuild:Compile Designer + MSBuild:Compile Designer diff --git a/Software/Visual_Studio/Tango.SimulateTouch.UI/TouchController.cs b/Software/Visual_Studio/Tango.SimulateTouch.UI/TouchController.cs new file mode 100644 index 000000000..144047b0c --- /dev/null +++ b/Software/Visual_Studio/Tango.SimulateTouch.UI/TouchController.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.SimulateTouch.UI.Native; + +namespace Tango.SimulateTouch.UI +{ + public static class TouchController + { + private static bool _initialized; + private static PointerTouchInfo? _currentContact; + + public static void Init() + { + if (!_initialized) + { + _initialized = true; + TouchInjector.InitializeTouchInjection(); + } + } + + public static void TouchDown(int x, int y) + { + Init(); + + var contact = MakePointerTouchInfo(x, y, 1); + PointerFlags oFlags = PointerFlags.DOWN | PointerFlags.INRANGE | PointerFlags.INCONTACT; + contact.PointerInfo.PointerFlags = oFlags; + bool bIsSuccess = TouchInjector.InjectTouchInput(1, new[] { contact }); + _currentContact = contact; + } + + public static void TouchUp() + { + Init(); + + if (_currentContact != null) + { + var contact = _currentContact.Value; + contact.PointerInfo.PointerFlags = PointerFlags.UP; + TouchInjector.InjectTouchInput(1, new[] { contact }); + _currentContact = null; + } + } + + public static void TouchMove(int deltaX, int deltaY) + { + Init(); + + if (_currentContact != null) + { + var contact = _currentContact.Value; + contact.Move(deltaX, deltaY); + var oFlags = PointerFlags.INRANGE | PointerFlags.INCONTACT | PointerFlags.UPDATE; + contact.PointerInfo.PointerFlags = oFlags; + TouchInjector.InjectTouchInput(1, new[] { contact }); + } + } + + private static PointerTouchInfo MakePointerTouchInfo(int x, int y, int radius, uint orientation = 90, uint pressure = 32000) + { + PointerTouchInfo contact = new PointerTouchInfo(); + contact.PointerInfo.pointerType = PointerInputType.TOUCH; + contact.TouchFlags = TouchFlags.NONE; + contact.Orientation = orientation; + contact.Pressure = pressure; + contact.TouchMasks = TouchMask.CONTACTAREA | TouchMask.ORIENTATION | TouchMask.PRESSURE; + contact.PointerInfo.PtPixelLocation.X = x; + contact.PointerInfo.PtPixelLocation.Y = y; + uint unPointerId = IdGenerator.GetUinqueUInt(); + contact.PointerInfo.PointerId = unPointerId; + contact.ContactArea.left = x - radius; + contact.ContactArea.right = x + radius; + contact.ContactArea.top = y - radius; + contact.ContactArea.bottom = y + radius; + return contact; + } + } +} -- cgit v1.3.1 From 4ae18ae6866056b9cb385b97f65a40e336402e18 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 7 Jun 2020 11:10:38 +0300 Subject: updated eeprom files - protobuf --- .../Messages/Stubs/StubDispenserEEpromData.proto | 30 +++++++++++----------- .../Stubs/StubMainCardEEpromWriteResponse.proto | 7 ++--- 2 files changed, 19 insertions(+), 18 deletions(-) (limited to 'Software') diff --git a/Software/PMR/Messages/Stubs/StubDispenserEEpromData.proto b/Software/PMR/Messages/Stubs/StubDispenserEEpromData.proto index 07328cf70..b5beda6de 100644 --- a/Software/PMR/Messages/Stubs/StubDispenserEEpromData.proto +++ b/Software/PMR/Messages/Stubs/StubDispenserEEpromData.proto @@ -12,26 +12,26 @@ message StubDispenserEEpromData string PCBS_N = 5; string PCBPartNumber = 6; string DispenserS_N = 7; - uint32 MinimalPressure = 8; - uint32 MaximalPressure = 9; - uint32 MinimalMV = 10; - uint32 MaximalMV = 11; + int32 MinimalPressure = 8; + int32 MaximalPressure = 9; + int32 MinimalMV = 10; + int32 MaximalMV = 11; uint32 TotalCycles = 12; - uint32 BubbleSize = 13; - uint32 AVG_Nl_stepValue_1_4 = 14; - uint32 AVG_Nl_stepValue_2_4 = 15; - uint32 AVG_Nl_stepValue_3_4 = 16; - uint32 AVG_Nl_stepValue_4_4 = 17; - uint32 SW_Reserve = 18; - int32 Spare1_pressure = 19; - int32 Spare2_pressure = 20; + int32 BubbleSize = 13; + int32 AVG_Nl_stepValue_1_4 = 14; + int32 AVG_Nl_stepValue_2_4 = 15; + int32 AVG_Nl_stepValue_3_4 = 16; + int32 AVG_Nl_stepValue_4_4 = 17; + int32 SW_Reserve = 18; + int32 Spare1_pressure = 19; + int32 Spare2_pressure = 20; uint32 MotorPulsesPerCycle = 21; uint32 Color = 22; - uint32 PressureSlope = 23; + int32 PressureSlope = 23; string ProductionDate = 24; uint32 ATSlocation = 25; - uint32 Spare1 = 26; - uint32 Spare2 = 27; + int32 Spare1 = 26; + int32 Spare2 = 27; uint32 ATSChannel = 28; bool UnitEmpty = 29; bool DryRunPass_Fail = 30; diff --git a/Software/PMR/Messages/Stubs/StubMainCardEEpromWriteResponse.proto b/Software/PMR/Messages/Stubs/StubMainCardEEpromWriteResponse.proto index f1e8a8897..db9dc8b3f 100644 --- a/Software/PMR/Messages/Stubs/StubMainCardEEpromWriteResponse.proto +++ b/Software/PMR/Messages/Stubs/StubMainCardEEpromWriteResponse.proto @@ -1,10 +1,11 @@ syntax = "proto3"; -package Tango.PMR.EmbeddedParameters; -option java_package = "com.twine.tango.pmr.embeddedparameters"; +package Tango.PMR.Stubs; +option java_package = "com.twine.tango.pmr.stubs"; message StubMainCardEEpromWriteResponse { - + int32 Address = 1; + int32 Data = 2; } -- cgit v1.3.1