Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 40 additions & 3 deletions ACT/LibMCEnv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,42 @@
</method>

</class>


<class name="ScatterPlotDataColumn" parent="Base">
<method name="GetColumnIdentifier" description="Returns the Column Identifier.">
<param name="ColumnIdentifier" type="string" pass="return" description="Identifier of the column to use. Must be alphanumeric and not empty." />
</method>
<method name="GetScaleFactor" description="Returns Scale Factor to use.">
<param name="ScaleFactor" type="double" pass="return" description="Scale factor to use. The channel value will be computed as raw value times scale factor plus offset factor." />
</method>
<method name="GetOffsetFactor" description="Returns Offset Factor to use.">
<param name="OffsetFactor" type="double" pass="return" description="Offset factor to use. The channel value will be computed as raw value times scale factor plus offset factor." />
</method>
</class>

<class name="ScatterPlotDataColumnIterator" parent="Iterator">
<method name="GetCurrentScatterPlotDataColumn" description="Returns the Current Channel Column the iterator points at.">
<param name="ScatterPlotDataColumnInstance" type="handle" class="ScatterPlotDataColumn" pass="return" description="returns the DataChannel instance."/>
</method>
</class>

<class name="ScatterPlotDataChannel" parent="Base">
<method name="GetChannelIdentifier" description="Returns the Scatter Plot Data Channel Identifier.">
<param name="ChannelIdentifier" type="string" pass="return" description="Identifier of the channel. Must be alphanumeric and not empty." />
</method>
<method name="AddScatterPlotDataColumn" description="Adds a new Columns to the Data Channel.">
<param name="ColumnInstance" type="class" class="ScatterPlotDataColumn" pass="in" description="Column Instance" />
</method>
<method name="ListScatterPlotDataColumns" description="Lists all Columns of the Data Channel.">
<param name="IteratorInstance" type="class" class="ScatterPlotDataColumnIterator" pass="return" description="Iterator instance." />
</method>
</class>

<class name="ScatterPlotDataChannelIterator" parent="Iterator">
<method name="GetCurrentScatterPlotDataChannel" description="Returns the Current Scatter Plot Data Channel the iterator points at.">
<param name="ScatterPlotDataChannelInstance" type="handle" class="ScatterPlotDataChannel" pass="return" description="returns the ScatterPlotDataChannel instance."/>
</method>
</class>

<class name="DataTableScatterPlotOptions" parent="Base" description="Configurates the creation of scatter plots from the data table.">

Expand Down Expand Up @@ -1045,9 +1080,11 @@
<param name="Color" type="uint32" pass="in" description="Base color to use." />
</method>

<method name="ListDataChannels" description="Lists all DataChannels of the ScatterPlot.">
<param name="IteratorInstance" type="class" class="ScatterPlotDataChannelIterator" pass="return" description="Iterator instance." />
</method>
</class>




<class name="DataTable" parent="Base" description="A in memory data table, streamable for example into a CSV file.">

Expand Down
2 changes: 1 addition & 1 deletion Artifacts/clientdist/_githash_client.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3de30d7f59cc739433600475d8cef345fb174622
544c5d51a9570433ce94e752dc4634fe0fa03e73
Binary file modified Artifacts/clientdist/clientpackage.zip
Binary file not shown.
Binary file modified Artifacts/clientdist/clientsourcepackage.zip
Binary file not shown.
51 changes: 49 additions & 2 deletions Client/src/common/AMCImplementation_LayerView.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,31 @@ class LayerViewImpl {
}

}

makeLaserOnColors ()
{
this.laserOnPointsColorArray = null;

if (this.laser && this.laser.laseron && this.layerPointsArray) {

let pointCount = this.layerPointsArray.length / 2;
let colors = [];

for (let pointIndex = 0; pointIndex < pointCount; pointIndex++) {

let laseron = this.laser.laseron[pointIndex];

// laseron = 0 => Blue
// laseron = 1 => Red
const hue = laseron * 240 / 360;

colors.push (this.hslToRgb (hue, 1.0, 0.5));
}

this.layerPointsColorArray = colors;
}

}

hslToRgb(h, s, l) {
// Ensure h, s, l are in the range [0, 1]
Expand Down Expand Up @@ -393,8 +418,17 @@ class LayerViewImpl {
this.layerPointsMinVelocity = LAYERVIEW_MINVELOCITYRANGE;

this.computeVelocities ();
this.updateColors ();
this.updateLayerPoints ();
}

loadPointsChannelData(pointsChannelName, pointsColumnName, pointsChannelDataArray) {

// Ensure the channel-level object exists
if (!Object.prototype.hasOwnProperty.call(this, pointsChannelName)) {
this[pointsChannelName] = {};
}

// Assign the data array to the corresponding column
this[pointsChannelName][pointsColumnName] = pointsChannelDataArray;
}

clearPoints ()
Expand All @@ -410,6 +444,16 @@ class LayerViewImpl {
this.updateLayerPoints ();
}

clearPointsChannelData (pointsChannelName)
{
// Ensure the channel-level object exists
if (Object.prototype.hasOwnProperty.call(this, pointsChannelName)) {
this[pointsChannelName] = {};
}

this.layerPointsColorArray = null;
}

updateColors ()
{
this.layerPointsColorArray = null;
Expand All @@ -422,6 +466,9 @@ class LayerViewImpl {
this.makeVelocityColors ();
}

if (this.layerPointsMode == "laseron") {
this.makeLaserOnColors ();
}
}

setColorMode (newColorMode) {
Expand Down
143 changes: 108 additions & 35 deletions Client/src/modules/AMCModule_LayerView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
this.LayerViewerInstance.setColorMode ("velocity");
}
else if (this.LayerViewerInstance.layerPointsMode == "velocity") {
this.LayerViewerInstance.setColorMode ("uniform");
this.LayerViewerInstance.setColorMode ("laseron");
}
else if (this.LayerViewerInstance.layerPointsMode == "laseron") {
this.LayerViewerInstance.setColorMode ("uniform");
} else {
this.LayerViewerInstance.setColorMode ("time");
}

}
},

onToggleToolpathClick: function () {
Expand Down Expand Up @@ -233,6 +235,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if (this.LayerViewerInstance.layerPointsMode == "velocity") {
return "Color: Velocity";
}

if (this.LayerViewerInstance.layerPointsMode == "laseron") {
return "Color: LaserOn";
}

return "Color: Uniform";
},
Expand Down Expand Up @@ -297,6 +303,86 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}
}
},

queryPoints: function (scatterplotuuid)
{
this.LayerViewerInstance.clearPoints ();

return this.Application.axiosGetArrayBufferRequest("/ui/pointcloud/" + scatterplotuuid)
.then(responseData => {
let pointcoordinates = new Float32Array(responseData.data);

if (this.LayerViewerInstance) {
this.LayerViewerInstance.loadPoints (pointcoordinates);
}
})
.catch(err => {
if (err.response) {
console.log (err.response);
} else {
console.log ("fatal error while retrieving point cloud ");
}
if (this.LayerViewerInstance) {
this.LayerViewerInstance.RenderScene (true);
}
});
},

queryPointsChannelData: function (scatterplotuuid, pointsChannelName)
{
this.LayerViewerInstance.clearPointsChannelData (pointsChannelName);

return this.Application.axiosGetArrayBufferRequest("/ui/pointchanneldata/" + scatterplotuuid + "/" + pointsChannelName)
.then(responseData => {

const contentType = responseData.headers['content-type'];

if (contentType && contentType.includes("application/json")) {

try {
const jsonText = new TextDecoder().decode(responseData.data);

const parsed = JSON.parse(jsonText);

if (parsed && typeof parsed === 'object') {

for (const [key, value] of Object.entries(parsed)) {

if (Array.isArray(value)) {
const floatArray = new Float32Array(value);
console.log(`Key "${key}" contains Float32Array with length: ${floatArray.length}`);
if (key.toLowerCase() === 'laseron') {
if (this.LayerViewerInstance) {
this.LayerViewerInstance.loadPointsChannelData ("laser", key.toLowerCase(), floatArray);
} else {
console.log(`${key}: ${floatArray.length}`);
}
}
} else {
console.warn(`Key "${key}" is not an array and will be ignored.`);
}
}
} else {
console.warn("Parsed JSON is not an object.");
}
} catch (e) {
console.error("Error while parsing JSON response:", e);
}
} else {
console.error("Error while parsing response: not a JSON");
}
})
.catch(err => {
if (err.response) {
console.log (err.response);
} else {
console.log ("fatal error while retrieving point cloud ");
}
if (this.LayerViewerInstance) {
this.LayerViewerInstance.RenderScene (true);
}
});
},

onLayerChanged: function (sender) {

Expand Down Expand Up @@ -333,45 +419,32 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
});


if (platform.scatterplotuuid != "00000000-0000-0000-0000-000000000000") {

this.loadingScatterplot = true;
this.LayerViewerInstance.glInstance.removeElement("layerdata_points");
this.LayerViewerInstance.clearPoints ();

this.Application.axiosGetArrayBufferRequest("/ui/pointcloud/" + platform.scatterplotuuid)
.then(responseData => {
let pointcoordinates = new Float32Array(responseData.data);

if (this.LayerViewerInstance) {
this.LayerViewerInstance.loadPoints (pointcoordinates);
}

this.loadingScatterplot = false;

})
.catch(err => {
if (err.response) {
console.log (err.response);
} else {
console.log ("fatal error while retrieving point cloud ");
}
if (this.LayerViewerInstance) {
this.LayerViewerInstance.RenderScene (true);
}

this.loadingScatterplot = false;
});
this.loadingScatterplot = true;
this.LayerViewerInstance.glInstance.removeElement("layerdata_points");

Promise.all([
this.queryPoints(platform.scatterplotuuid),
this.queryPointsChannelData(platform.scatterplotuuid, "laser")
]).then(() => {
if (this.LayerViewerInstance && this.LayerViewerInstance.updateLayerPoints) {
this.LayerViewerInstance.updateColors ();
this.LayerViewerInstance.updateLayerPoints();
}
});

this.loadingScatterplot = false;

} else {

this.loadingScatterplot = false;
this.LayerViewerInstance.glInstance.removeElement("layerdata_points");

this.LayerViewerInstance.clearPoints ();


}

this.LayerViewerInstance.clearPointsChannelData ("laser")

}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ void CSMCJobInstance::ReadSimulationFile(LibMCEnv::PDataTable pDataTable)
}
}
else if (version.m_nMajor == 1) {
if (version.m_nMinor == 0)
if (version.m_nMinor == 0 || version.m_nMinor == 1)
{
if (m_bSendToHardware)
ReadLogRecordFile(pDataTable);
Expand Down
Loading