Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 7d56faf

Browse files
Renamed the widget to 3d model viewer
1 parent 09d3ed1 commit 7d56faf

22 files changed

+43
-43
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Cumulocity IoT 3D Collada Widget
1+
# 3D Model Viewer Widget for Cumulocity IoT
22

33
This is a runtime widget to view a 3D collada model (*.dae) in Cumulocity IoT.
44

@@ -11,25 +11,25 @@ This is a runtime widget to view a 3D collada model (*.dae) in Cumulocity IoT.
1111
* Allows to upload custom collada(.dae) model file.
1212

1313
### Installation - for the dashboards using Runtime Widget Loader
14-
1. Download the latest `3dcollada-widget-{version}.zip` file from the Releases section.
14+
1. Download the latest `3d-model-viewer-widget-{version}.zip` file from the Releases section.
1515
2. Make sure you have Runtime Widget Loader installed on your Cockpit or App Builder app.
1616
3. Open a dashboard.
1717
4. Click `more...`.
1818
5. Select `Install Widget` and follow the instructions.
1919

2020
### Deployment - as part of the Cumulocity IoT Cockpit application
21-
1. Clone the repository on your local machine using `git clone https://github.com/SoftwareAG/cumulocity-3d-collada-widget.git`.
21+
1. Clone the repository on your local machine using `git clone https://github.com/SoftwareAG/cumulocity-3d-model-viewer-widget.git`.
2222
2. Run `npm install` to install the module dependencies.
2323
3. Run `c8ycli build` to build the cockpit application.
2424
4. Run `c8ycli deploy` and follow the instructions to deploy the cockpit application on your tenant. This will include the widget also.
2525

2626
### Configuration - to view the 3d collada model in the widget
2727
1. Make sure you have successfully installed or deployed the widget.
2828
2. Click on `Add widget`.
29-
3. Choose `3d collada` widget.
29+
3. Choose `3d model viewer` widget.
3030
4. `Title` is the title of widget. Provide a relevant name. You may choose to hide this. Go to `Appearance` tab and choose `Hidden` under `Widget header style`.
3131
5. Select the `device`.
32-
6. `3d collada file(*.dae)` is to upload the 3d collada model file (*.dae) into inventory binary. Please wait for it to finish the upload.
32+
6. `Model file(*.dae)` is to upload the model file (*.dae) into inventory binary. Please wait for it to finish the upload.
3333
7. `Variables` is to declare variables with a constant value or map them to the realtime device measurement series. Choose Target as None and provide the constant value or choose Target as Device and then select a measurment series.
3434
8. `Properties` is to define values for the model properties. You can provide a value as an mathematical expression using the variables defined earlier.
3535
9. `Background color (in hex)` allows you to set a custom background color using the color picker.
@@ -38,7 +38,7 @@ This is a runtime widget to view a 3D collada model (*.dae) in Cumulocity IoT.
3838
12. In case you see unexpected results on the widget, refer to browser console to see if there are error logs.
3939

4040
### Development - to do the enhancements and testing locally
41-
1. Clone the repository on local machine using `git clone https://github.com/SoftwareAG/cumulocity-3d-collada-widget.git`.
41+
1. Clone the repository on local machine using `git clone https://github.com/SoftwareAG/cumulocity-3d-model-viewer-widget.git`.
4242
2. Run `npm install` to download the module dependencies.
4343
3. Install c8ycli `npm install -g @c8y/cli` if not already.
4444
4. Run `c8ycli server -u https://your_tenant_url` to start the server.

app.module.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ import { AssetsNavigatorModule } from '@c8y/ngx-components/assets-navigator';
1313
import { CockpitDashboardModule } from '@c8y/ngx-components/context-dashboard';
1414
import { ReportsModule } from '@c8y/ngx-components/reports';
1515
import { SensorPhoneModule } from '@c8y/ngx-components/sensor-phone';
16-
import { ColladaWidget } from './src/collada-widget/collada-widget.component';
17-
import { ColladaWidgetConfig } from './src/collada-widget/collada-widget-config.component';
18-
import { ColorPaletteComponent } from './src/collada-widget/color-picker/color-palette/color-palette-component';
19-
import { ColorSliderComponent } from './src/collada-widget/color-picker/color-slider/color-slider-component';
20-
import { ColorPickerComponent } from './src/collada-widget/color-picker/color-picker-component';
16+
import { ModelViewerWidget } from './src/model-viewer-widget/model-viewer-widget.component';
17+
import { ModelViewerWidgetConfig } from './src/model-viewer-widget/model-viewer-widget-config.component';
18+
import { ColorPaletteComponent } from './src/model-viewer-widget/color-picker/color-palette/color-palette-component';
19+
import { ColorSliderComponent } from './src/model-viewer-widget/color-picker/color-slider/color-slider-component';
20+
import { ColorPickerComponent } from './src/model-viewer-widget/color-picker/color-picker-component';
2121

2222
@NgModule({
2323
imports: [
@@ -32,18 +32,18 @@ import { ColorPickerComponent } from './src/collada-widget/color-picker/color-pi
3232
SensorPhoneModule,
3333
UpgradeModule
3434
],
35-
declarations: [ColladaWidget, ColladaWidgetConfig, ColorPickerComponent, ColorSliderComponent, ColorPaletteComponent],
36-
entryComponents: [ColladaWidget, ColladaWidgetConfig],
35+
declarations: [ModelViewerWidget, ModelViewerWidgetConfig, ColorPickerComponent, ColorSliderComponent, ColorPaletteComponent],
36+
entryComponents: [ModelViewerWidget, ModelViewerWidgetConfig],
3737
providers: [{
3838
provide: HOOK_COMPONENTS,
3939
multi: true,
4040
useValue: [
4141
{
42-
id: 'com.softwareag.globalpresales.colladawidget',
43-
label: '3D Collada',
42+
id: 'com.softwareag.globalpresales.3dmodelviewerwidget',
43+
label: '3d model viewer',
4444
description: 'A runtime widget to view a 3d collada model (*.dae) in Cumulocity IoT. It has been developed by Global Presales team.',
45-
component: ColladaWidget,
46-
configComponent: ColladaWidgetConfig,
45+
component: ModelViewerWidget,
46+
configComponent: ModelViewerWidgetConfig,
4747
previewImage: require("./assets/img-preview.png")
4848
}
4949
]

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "collada-widget",
2+
"name": "3d-model-viewer-widget",
33
"interleave": {
4-
"dist\\bundle-src\\custom-widget.js": "collada-widget-CustomWidget",
5-
"dist/bundle-src/custom-widget.js": "collada-widget-CustomWidget"
4+
"dist\\bundle-src\\custom-widget.js": "3d-model-viewer-widget-CustomWidget",
5+
"dist/bundle-src/custom-widget.js": "3d-model-viewer-widget-CustomWidget"
66
},
77
"version": "1.0.0",
88
"description": "",

src/collada-widget/collada-widget-config.component.html renamed to src/model-viewer-widget/model-viewer-widget-config.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<c8y-form-group>
33

44
<!-- Model File -->
5-
<label for="model-file" translate>3d collada file (*.dae)</label>
5+
<label for="model-file" translate>Model file (*.dae)</label>
66
<input type="text" class="form-control" [(ngModel)]="widgetInfo.binaryName" readonly />
77
<input type="file" class="form-control" name="model-file" (change)="uploadModelFile($event.target.files)" accept=".dae,model/vnd.collada+xml" />
88
<div>{{modelFileUploadMessage}}</div>

src/collada-widget/collada-widget-config.component.ts renamed to src/model-viewer-widget/model-viewer-widget-config.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ import * as _ from 'lodash';
2424
import { ColladaLoader } from 'three/examples/jsm/loaders/ColladaLoader.js';
2525

2626
@Component({
27-
selector: 'collada-widget-config',
28-
templateUrl: './collada-widget-config.component.html',
29-
styleUrls: ['./collada-widget-config.component.css']
27+
selector: 'model-viewer-widget-config',
28+
templateUrl: './model-viewer-widget-config.component.html',
29+
styleUrls: ['./model-viewer-widget-config.component.css']
3030
})
31-
export class ColladaWidgetConfig implements OnInit {
31+
export class ModelViewerWidgetConfig implements OnInit {
3232
@Input() config: any = {};
3333

3434
backgroundColorPickerClosed : boolean = true;

src/collada-widget/collada-widget.component.ts renamed to src/model-viewer-widget/model-viewer-widget.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ import { ColladaLoader } from 'three/examples/jsm/loaders/ColladaLoader.js';
2525
import * as mathjs from 'mathjs';
2626

2727
@Component({
28-
selector: 'collada-widget',
29-
templateUrl: './collada-widget.component.html',
28+
selector: 'model-viewer-widget',
29+
templateUrl: './model-viewer-widget.component.html',
3030
styles: []
3131
})
32-
export class ColladaWidget implements OnInit {
32+
export class ModelViewerWidget implements OnInit {
3333
@Input() config;
3434

3535
public modelContainerId;
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { NgModule } from '@angular/core';
22
import { CoreModule, HOOK_COMPONENTS } from '@c8y/ngx-components';
3-
import { ColladaWidget } from './collada-widget.component';
4-
import { ColladaWidgetConfig } from './collada-widget-config.component';
3+
import { ModelViewerWidget } from './model-viewer-widget.component';
4+
import { ModelViewerWidgetConfig } from './model-viewer-widget-config.component';
55
import { ColorPickerComponent } from './color-picker/color-picker-component';
66
import { ColorSliderComponent } from './color-picker/color-slider/color-slider-component';
77
import { ColorPaletteComponent } from './color-picker/color-palette/color-palette-component';
@@ -10,19 +10,19 @@ import { ColorPaletteComponent } from './color-picker/color-palette/color-palett
1010
imports: [
1111
CoreModule
1212
],
13-
declarations: [ColladaWidget, ColladaWidgetConfig, ColorPickerComponent, ColorSliderComponent, ColorPaletteComponent],
14-
entryComponents: [ColladaWidget, ColladaWidgetConfig],
13+
declarations: [ModelViewerWidget, ModelViewerWidgetConfig, ColorPickerComponent, ColorSliderComponent, ColorPaletteComponent],
14+
entryComponents: [ModelViewerWidget, ModelViewerWidgetConfig],
1515
providers: [{
1616
provide: HOOK_COMPONENTS,
1717
multi: true,
1818
useValue: {
19-
id: 'com.softwareag.globalpresales.colladawidget',
20-
label: '3d collada',
19+
id: 'com.softwareag.globalpresales.3dmodelviewerwidget',
20+
label: '3d model viewer',
2121
description: 'A runtime widget to view a 3d collada model (*.dae) in Cumulocity IoT. It has been developed by Global Presales team.',
22-
component: ColladaWidget,
23-
configComponent: ColladaWidgetConfig,
22+
component: ModelViewerWidget,
23+
configComponent: ModelViewerWidgetConfig,
2424
previewImage: require("~assets/img-preview.png")
2525
}
2626
}],
2727
})
28-
export class ColladaWidgetAppModule {}
28+
export class ModelViewerWidgetAppModule {}

src/public_api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
/* Add your widget's module(s) here */
22

3-
export { ColladaWidgetAppModule } from "./collada-widget/collada-widget.module";
3+
export { ModelViewerWidgetAppModule } from "./model-viewer-widget/model-viewer-widget.module";

widget-cumulocity.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "3d collada",
3-
"contextPath": "collada-widget",
4-
"key": "collada-widget-application-key",
2+
"name": "3D Model Viewer Widget",
3+
"contextPath": "3d-model-viewer-widget",
4+
"key": "3d-model-viewer-widget-application-key",
55
"contentSecurityPolicy": "default-src 'self'",
66
"icon": {
77
"class": "fa fa-puzzle-piece"

0 commit comments

Comments
 (0)