Mercurial > hg > orthanc-stone
comparison Resources/CodeGeneration/stonegentool.py @ 508:7105a0bad250 bgo-commands-codegen
- Added HandleSerializedMessage to IStoneApplication (empty impl)
- Split UpdateWebApplication with "WithString" and "WithSerializedMessage" variants
- Due to the modules in TS, globals are now unallowed and the callbacks from C++ to JS are stored in the "window" instance
- Split UpdateStoneApplicationStatusFromCpp with "WithString" and "WithSerializedMessage" variants
- Split NotifyStatusUpdateFromCppToWeb with "WithString" and "WithSerializedMessage" variants
- SendMessageToStoneApplication (C++ global) has been split into SendSerializedMessageToStoneApplication and SendCommandToStoneApplication
- In WasmPlatformApplicationAdapter: HandleMessageFromWeb becomes HandleCommandFromWeb
- In WasmPlatformApplicationAdapter: added HandleSerializedMessageFromWeb
- stonegentool now handles the "json" primitive type (used, a.o., in the VSOL "EditInstance" message)
- Fixed indentation and added json serialization overloads in the stonegentool templates
- Added test of the json primitive type to testWasmIntegrated (in Resources/CodeGeneration)
- Adapted testWasmIntegrated (in Resources/CodeGeneration) to the changes above
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 06 Mar 2019 10:14:59 +0100 |
parents | ce49eae4c887 |
children | dea3787a8f4b |
comparison
equal
deleted
inserted
replaced
507:ce49eae4c887 | 508:7105a0bad250 |
---|---|
108 retVal = retVal.replace("vector", "std::vector") | 108 retVal = retVal.replace("vector", "std::vector") |
109 retVal = retVal.replace("string", "std::string") | 109 retVal = retVal.replace("string", "std::string") |
110 retVal = retVal.replace("int32", "int32_t") | 110 retVal = retVal.replace("int32", "int32_t") |
111 retVal = retVal.replace("float32", "float") | 111 retVal = retVal.replace("float32", "float") |
112 retVal = retVal.replace("float64", "double") | 112 retVal = retVal.replace("float64", "double") |
113 retVal = retVal.replace("json", "Json::Value") | |
113 return retVal | 114 return retVal |
114 | 115 |
115 def CanonToTs(canonicalTypename): | 116 def CanonToTs(canonicalTypename): |
116 # TS: replace vector with Array and map with Map | 117 # TS: replace vector with Array and map with Map |
117 # string remains string | 118 # string remains string |
123 retVal = retVal.replace("vector", "Array") | 124 retVal = retVal.replace("vector", "Array") |
124 retVal = retVal.replace("int32", "number") | 125 retVal = retVal.replace("int32", "number") |
125 retVal = retVal.replace("float32", "number") | 126 retVal = retVal.replace("float32", "number") |
126 retVal = retVal.replace("float64", "number") | 127 retVal = retVal.replace("float64", "number") |
127 retVal = retVal.replace("bool", "boolean") | 128 retVal = retVal.replace("bool", "boolean") |
129 retVal = retVal.replace("json", "Object") | |
128 return retVal | 130 return retVal |
129 | 131 |
130 def NeedsTsConstruction(enums, tsType): | 132 def NeedsTsConstruction(enums, tsType): |
131 if tsType == 'boolean': | 133 if tsType == 'boolean': |
132 return False | 134 return False |