@@ -57,7 +57,6 @@ type MechanismExtraState = {
5757 mechanismId ?: string ,
5858 importModule ?: string ,
5959 parameters ?: Parameter [ ] ,
60- parametersHaveComponentInformation ?: boolean ,
6160}
6261
6362const WARNING_ID_NOT_IN_HOLDER = 'not in holder' ;
@@ -69,7 +68,6 @@ interface MechanismMixin extends MechanismMixinType {
6968 mrcMechanismId : string ,
7069 mrcImportModule : string ,
7170 mrcParameters : Parameter [ ] ,
72- mrcParametersHaveComponentInformation : boolean ,
7371
7472 /**
7573 * mrcHasNotInHolderWarning is set to true if we set the NOT_IN_HOLDER warning text on the block.
@@ -87,7 +85,6 @@ const MECHANISM = {
8785 * Block initialization.
8886 */
8987 init : function ( this : MechanismBlock ) : void {
90- this . mrcParametersHaveComponentInformation = false ;
9188 this . mrcHasNotInHolderWarning = false ;
9289 this . setStyle ( MRC_STYLE_MECHANISMS ) ;
9390 const nameField = new Blockly . FieldTextInput ( '' )
@@ -107,7 +104,6 @@ const MECHANISM = {
107104 const extraState : MechanismExtraState = {
108105 mechanismModuleId : this . mrcMechanismModuleId ,
109106 mechanismId : this . mrcMechanismId ,
110- parametersHaveComponentInformation : this . mrcParametersHaveComponentInformation ,
111107 } ;
112108 extraState . parameters = [ ] ;
113109 this . mrcParameters . forEach ( ( arg ) => {
@@ -131,8 +127,6 @@ const MECHANISM = {
131127 this . mrcParameters . push ( { ...arg } ) ;
132128 } ) ;
133129 }
134- this . mrcParametersHaveComponentInformation = ( extraState . parametersHaveComponentInformation == undefined )
135- ? false : extraState . parametersHaveComponentInformation ;
136130 this . updateBlock_ ( ) ;
137131 } ,
138132 /**
@@ -302,7 +296,6 @@ const MECHANISM = {
302296 componentPortsIndex ++ ;
303297 }
304298 } ) ;
305- this . mrcParametersHaveComponentInformation = true ;
306299 this . updateBlock_ ( ) ;
307300 } else {
308301 // Did not find the mechanism.
@@ -331,12 +324,6 @@ const MECHANISM = {
331324 this . mrcMechanismId = oldIdToNewId [ this . mrcMechanismId ] ;
332325 }
333326 } ,
334- upgrade_005_to_006 : function ( this : MechanismBlock ) {
335- // At the time when this upgrade method is called, we can't look up the component information
336- // for each parameter. Instead, we just mark this block as not having the information. Later,
337- // in the checkMechanism method, we will retrieve the component information for each parameter.
338- this . mrcParametersHaveComponentInformation = false ;
339- } ,
340327} ;
341328
342329export const setup = function ( ) {
@@ -372,7 +359,6 @@ export function createMechanismBlock(
372359 mechanismModuleId : mechanism . moduleId ,
373360 importModule : snakeCaseName ,
374361 parameters : [ ] ,
375- parametersHaveComponentInformation : true ,
376362 } ;
377363 const inputs : { [ key : string ] : any } = { } ;
378364 let i = 0 ;
@@ -396,13 +382,3 @@ export function createMechanismBlock(
396382 fields [ FIELD_TYPE ] = mechanism . className ;
397383 return new toolboxItems . Block ( BLOCK_NAME , extraState , fields , inputs ) ;
398384}
399-
400- /**
401- * Upgrades the MechanismBlocks in the given workspace from version 005 to 006.
402- * This function should only be called when upgrading old projects.
403- */
404- export function upgrade_005_to_006 ( workspace : Blockly . Workspace ) : void {
405- workspace . getBlocksByType ( BLOCK_NAME ) . forEach ( block => {
406- ( block as MechanismBlock ) . upgrade_005_to_006 ( ) ;
407- } ) ;
408- }
0 commit comments