Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/app/component/edit-panel/edit-panel.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
(closed)="sectionExpanded['JDistToJ'] = false">
<div *ngFor='let joint of listOfOtherJoints; let i=index'>
<!-- The repeated alias template -->
<dual-input-block label1='D' label2='⊾' tooltip='TODO' [formGroup]='jointForm' formSubGroup='otherJoints'
<dual-input-block label1='' label2='⊾' tooltip='TODO' [formGroup]='jointForm' formSubGroup='otherJoints'
[formControl1]='(i*2).toString()' [formControl2]='(i*2+1).toString()'
(field1Entry)='setShowLinkLengthOverlay($event)'
(field2Entry)='setShowLinkAngleOverlay($event)'
Expand All @@ -138,7 +138,7 @@
(opened)="sectionExpanded['LBasic'] = true"
(closed)="sectionExpanded['LBasic'] = false">
<dual-input-block
label1='L'
label1=''
label2='⊾'
formControl1='length'
formControl2='angle'
Expand Down
14 changes: 7 additions & 7 deletions src/app/component/edit-panel/edit-panel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export class EditPanelComponent implements OnInit, AfterContentInit, OnDestroy {
this.settingsService.lengthUnit.getValue()
);
if (!success) {
this.jointForm.patchValue({ xPos: this.activeSrv.selectedJoint.x.toFixed(2).toString() });
this.jointForm.patchValue({ xPos: this.activeSrv.selectedJoint.x.toFixed(4).toString() });
} else {
this.activeSrv.selectedJoint.x = value;
this.gridUtils.dragJoint(
Expand All @@ -220,7 +220,7 @@ export class EditPanelComponent implements OnInit, AfterContentInit, OnDestroy {
this.settingsService.lengthUnit.getValue()
);
if (!success) {
this.jointForm.patchValue({ yPos: this.activeSrv.selectedJoint.y.toFixed(2).toString() });
this.jointForm.patchValue({ yPos: this.activeSrv.selectedJoint.y.toFixed(4).toString() });
} else {
this.activeSrv.selectedJoint.y = value;
this.gridUtils.dragJoint(
Expand Down Expand Up @@ -343,7 +343,7 @@ export class EditPanelComponent implements OnInit, AfterContentInit, OnDestroy {
);
if (!success) {
this.linkForm.patchValue({
length: this.activeSrv.selectedLink.length.toFixed(2).toString(),
length: this.activeSrv.selectedLink.length.toFixed(4).toString(),
});
} else {
this.activeSrv.selectedLink.length = value;
Expand Down Expand Up @@ -406,7 +406,7 @@ export class EditPanelComponent implements OnInit, AfterContentInit, OnDestroy {
);
if (!success) {
this.forceForm.patchValue({
magnitude: this.activeSrv.selectedForce.mag.toFixed(2).toString(),
magnitude: this.activeSrv.selectedForce.mag.toFixed(4).toString(),
});
} else {
this.activeSrv.selectedForce.mag = value;
Expand All @@ -433,7 +433,7 @@ export class EditPanelComponent implements OnInit, AfterContentInit, OnDestroy {
);
if (!success) {
this.forceForm.patchValue({
angle: this.activeSrv.selectedForce.angleRad.toFixed(2).toString(),
angle: this.activeSrv.selectedForce.angleRad.toFixed(4).toString(),
});
} else {
//Always convert to Radian since Force.angle is in Radian
Expand Down Expand Up @@ -463,7 +463,7 @@ export class EditPanelComponent implements OnInit, AfterContentInit, OnDestroy {
);
if (!success) {
this.forceForm.patchValue({
xComp: this.activeSrv.selectedForce.xComp.toFixed(2).toString(),
xComp: this.activeSrv.selectedForce.xComp.toFixed(4).toString(),
});
} else {
this.activeSrv.selectedForce.xComp = value;
Expand All @@ -487,7 +487,7 @@ export class EditPanelComponent implements OnInit, AfterContentInit, OnDestroy {
);
if (!success) {
this.forceForm.patchValue({
yComp: this.activeSrv.selectedForce.yComp.toFixed(2).toString(),
yComp: this.activeSrv.selectedForce.yComp.toFixed(4).toString(),
});
} else {
this.activeSrv.selectedForce.yComp = value;
Expand Down
55 changes: 26 additions & 29 deletions src/app/component/new-grid/new-grid.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export class NewGridComponent {
.setOptions({
steps: [
{
title: '👋 Welcome',
title: 'Welcome!',
intro: 'Let us show you around Planar Mechanism Kinematic Simulator Plus!',
},
{
Expand All @@ -165,13 +165,10 @@ export class NewGridComponent {
element: document.querySelector('#helpButton') as HTMLElement,
intro: 'If you get stuck at any point, click here for help.',
},
{
element: document.querySelector('#templatesButton') as HTMLElement,
title: "🙌 That's it!",
intro: 'Get started by opening an example linkage!',
},
],
dontShowAgain: true,
showProgress: true,
disableInteraction: true,
})
.start();
});
Expand Down Expand Up @@ -250,13 +247,6 @@ export class NewGridComponent {
// console.log(this.lastRightClick.constructor.name);
switch (this.lastRightClick.constructor.name) {
case 'Force':
this.cMenuItems.push(
new cMenuItem(
'Delete Force',
this.mechanismSrv.deleteForce.bind(this.mechanismSrv),
'remove'
)
);
//Switch force direction, switch force local, delete Force
this.cMenuItems.push(
new cMenuItem(
Expand All @@ -272,21 +262,21 @@ export class NewGridComponent {
'switch_force_dir'
)
);
this.cMenuItems.push(
new cMenuItem(
'Delete Force',
this.mechanismSrv.deleteForce.bind(this.mechanismSrv),
'remove'
)
);
break;
case 'RealLink':
//Delete Link, Attach Link, Attach Tracer Point, Attach Joint
//Attach Link, Attach Tracer Point, Attach Joint, Delete Link
//Don't give options if a fillet it selected and not a primary link
let weldedLinkFilletSelected =
(this.lastRightClick as RealLink).isWelded &&
(this.lastRightClick as RealLink).lastSelectedSublink == null;

this.cMenuItems.push(
new cMenuItem(
'Delete Link',
this.mechanismSrv.deleteLink.bind(this.mechanismSrv),
'remove'
)
);
this.cMenuItems.push(
new cMenuItem(
'Attach Link',
Expand All @@ -311,6 +301,13 @@ export class NewGridComponent {
weldedLinkFilletSelected || !this.settings.isForces.value
)
);
this.cMenuItems.push(
new cMenuItem(
'Delete Link',
this.mechanismSrv.deleteLink.bind(this.mechanismSrv),
'remove'
)
);
break;
case 'RevJoint':
let jointIsSlider = this.gridUtils.isAttachedToSlider(this.lastRightClick);
Expand All @@ -321,14 +318,6 @@ export class NewGridComponent {
let canTogglePath =
!(this.lastRightClick as RealJoint).ground && this.mechanismSrv.oneValidMechanismExists();

this.cMenuItems.push(
new cMenuItem(
'Delete Joint',
this.mechanismSrv.deleteJoint.bind(this.mechanismSrv),
'remove'
)
);

this.cMenuItems.push(
new cMenuItem('Attach Link', this.startCreatingLink.bind(this), 'new_link')
);
Expand Down Expand Up @@ -392,6 +381,14 @@ export class NewGridComponent {
// !canTogglePath
// )
// ); //Rev Joint - Not Ground and at least one valid mechanism exists

this.cMenuItems.push(
new cMenuItem(
'Delete Joint',
this.mechanismSrv.deleteJoint.bind(this.mechanismSrv),
'remove'
)
);
break;

case 'String': //This means grid
Expand Down
2 changes: 1 addition & 1 deletion src/app/component/right-panel/right-panel.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<title-block>Help</title-block>
<div style='padding: 10px 0 10px 10px; width: calc(100% - 20px);'>
<button-block icon='help_center' [click]='gotoHelpSite'>Tutorial Videos</button-block>
<!-- <button-block icon='info' [click]='sendNotReady'>Restart Tutorial</button-block> -->
<button-block icon='info' [click]='resetTutorial'>Restart Tutorial (Refresh Required)</button-block>
<subtitle-block> PMKS+ is open source! Do you want to help us develop it?</subtitle-block>
<button-block customIcon='github' [click]='gotoGithub'>Github Repo</button-block>
</div>
Expand Down
11 changes: 7 additions & 4 deletions src/app/component/right-panel/right-panel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ export class RightPanelComponent {
// console.warn(this.isOpen);
}

static closeOpenTab() {
if(this.isOpen)
this.isOpen = false;
}

getOpenTab() {
return RightPanelComponent.openTab;
}
Expand Down Expand Up @@ -277,10 +282,8 @@ export class RightPanelComponent {
logEvent(this.analytics, 'goto_github');
}

sendNotReady() {
introJs().start();
// NewGridComponent.sendNotification('Sorry, the tutorial is not ready yet.');
// logEvent(this.analytics, 'tutorial_not_ready');
resetTutorial() {
introJs().setDontShowAgain(false);
}

getBrowserName() {
Expand Down
4 changes: 4 additions & 0 deletions src/app/component/toolbar/toolbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ export class ToolbarComponent implements OnInit, AfterViewInit {
RightPanelComponent.tabClicked(4);
}

closeRightPanelTab() {
RightPanelComponent.closeOpenTab();
}

animate: boolean = false;

// static inputAngularVelocity: number = 10;
Expand Down
12 changes: 6 additions & 6 deletions src/app/services/number-unit-parser.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ export class NumberUnitParserService {
public formatValueAndUnit(value: number, units: LengthUnit | AngleUnit | ForceUnit): string {
switch (units) {
case LengthUnit.CM:
return value.toFixed(2) + ' cm';
return value.toFixed(4) + ' cm';
case LengthUnit.METER:
return value.toFixed(2) + ' m';
return value.toFixed(4) + ' m';
case LengthUnit.INCH:
return value.toFixed(2) + ' in';
return value.toFixed(4) + ' in';
case AngleUnit.DEGREE:
return value.toFixed(0) + ' deg';
case AngleUnit.RADIAN:
return value.toFixed(2) + ' rad';
return value.toFixed(4) + ' rad';
case ForceUnit.LBF:
return value.toFixed(2) + ' lbf';
return value.toFixed(4) + ' lbf';
case ForceUnit.NEWTON:
return value.toFixed(2) + ' N';
return value.toFixed(4) + ' N';
}
return 'Error in formatValueAndUnit()';
}
Expand Down
9 changes: 5 additions & 4 deletions src/assets/icons/add_slider.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/assets/icons/add_slider_old.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions src/assets/icons/remove_slider.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/assets/icons/remove_slider_old.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.